1. 19 Mar, 2019 2 commits
  2. 18 Mar, 2019 3 commits
    • Karel Koci's avatar
      Integrate new URI implementation · 9926663d
      Karel Koci authored
      This commit changes a lot of functionality including user visible ones
      such as configuration language.
      
      The most significant from users point is that in configuration language
      functions no longer return handlers for configuration they created. This
      is to simplify implementation. The correct approach is to use package or
      repository name instead of handler. Handler usage was less powerful and
      because of sandboxing also unusable across multiple scripts.
      
      There are additional changes in form of obsoleted extra options for
      configuration commands. Repository's extra option subdirs is obsoleted
      and works differently and much more. Please review changes in language
      documentation file.
      9926663d
    • Karel Koci's avatar
      Add Lua module for URI implemented in C · a718f158
      Karel Koci authored
      This exports URI and downloader in wrapped form to Lua.
      a718f158
    • Karel Koci's avatar
      Implement URI in C · 310154c9
      Karel Koci authored
      This is C implementation of URI with configuration inheritance and
      ability to have relative URIs.
      310154c9
  3. 07 Mar, 2019 11 commits
    • Karel Koci's avatar
      Fix subprocess function lvsubprocv · e0b80042
      Karel Koci authored
      e0b80042
    • Karel Koci's avatar
      Add multiwrite · dcb7a8cf
      Karel Koci authored
      This is simple wrapper on top of multiple opened files. Idea is that you
      can open additional files and all subsequent writes are written to all
      of those files.
      The intended use is for collecting CA and CRL certificates to single
      file. In that implementation we can have multiple nodes reusing same
      base list of CAs and CRLs. To allows deallocation of deployed
      certificates we create files that can be read later when ever we detect
      such reuse. This simple code makes this operation as easy as writing to
      single file descriptor.
      dcb7a8cf
    • Karel Koci's avatar
      subprocess: suppress redefine warning · 96491a8d
      Karel Koci authored
      96491a8d
    • Karel Koci's avatar
      Add new subprocess logging type USIGN · 2a84d8c1
      Karel Koci authored
      usign is command we have to run as there is no attached library
      implementation of given algorithm (at least to my knowledge). But its
      output should be mostly ignored because of that there is exception
      created for LST_USIGN for output printing level.
      2a84d8c1
    • Karel Koci's avatar
      downloader: expand user agent to contain OS release name · 616234d7
      Karel Koci authored
      This should give us ability to debug problems with stucked versions.
      616234d7
    • Karel Koci's avatar
      Add syscnf module and drop some config variables · b93311ab
      Karel Koci authored
      Incompatible changes:
      * --model and --board options were dropped for both pkgupdate and
        pkgtransaction
      
      Following variables were dropped from updater configuration scripts:
      * board_name, model: this should be replaced by distribution root script
      * serial: same case like board_name and model
      * architectures: replaced by LEDE_ARCH of os_release
      
      New variables were introduced as a partial replacement:
      * os_release: target system etc/os-release content
      * host_os_release: host system /etc/os-release content
      b93311ab
    • Karel Koci's avatar
      logging: solve some warning · 8fd3e47a
      Karel Koci authored
      8fd3e47a
    • Karel Koci's avatar
      download: add function that overtakes buffer · 75342e2c
      Karel Koci authored
      This adds instance free function that instead of deallocating output
      buffer passes it to caller. This is handy if you want to preserve
      downloaded data but no longer need download instance or downloader as a
      whole.
      75342e2c
    • Karel Koci's avatar
      download: add possibility to download to temporally file · ed17313f
      Karel Koci authored
      This uses standard function mkstemp to generate random file name,
      anything else is same as in case of download_file.
      
      This also changes behaviour of download_file so that it truncates file.
      It makes much more sense because otherwise we would append data. If we
      ever need append data then it would make sense to have dedicated option
      for it.
      ed17313f
    • Karel Koci's avatar
      Add tests for download manager · 29d7a781
      Karel Koci authored
      These tests check if we are able to download data from internet and if
      we are able to do certification pinning. There can be even more done but
      let's extend these tests on need to test bases.
      29d7a781
    • Karel Koci's avatar
      Add download manager · d21eba3e
      Karel Koci authored
      This is extraction of existing code from events.c.
      d21eba3e
  4. 28 Feb, 2019 3 commits
    • Karel Koci's avatar
      updater: do not download package unless we know that it is approved · 0be0315a
      Karel Koci authored
      We do not download any package unless we know that they are going to be
      installed with this commit. It is done by split of download to separate
      function.
      0be0315a
    • Karel Koci's avatar
      transaction: instead of data use files on fs · 5b9b4d2f
      Karel Koci authored
      This replaces problematic data pass in Lua with files saved on disk.
      Original problem is that Lua in some cases like closures duplicates
      environment and that means also all data. If this happens few times
      (from measurements it seems like two or three times in code segment we
      are dropping in this) then we can have few times bigger memory
      requirements.
      
      This also temporally disables test test-sys-pkgupdate-plan-unapproved as
      it does not expect additional files. This is going to be solved in
      following commit.
      5b9b4d2f
    • Karel Koci's avatar
      updater: drop missed content related code · d859ed55
      Karel Koci authored
      This code was here because of package content option but this feature is
      obsoleted and dropped so we can drop this code as well.
      d859ed55
  5. 06 Feb, 2019 1 commit
  6. 28 Jan, 2019 3 commits
  7. 21 Jan, 2019 1 commit
  8. 12 Dec, 2018 5 commits
    • Karel Koci's avatar
      subprocess: fix problem with lost stdout content · 8502ac4b
      Karel Koci authored
      I originally was thinking that Lua is doing something nasty like
      duplicating original file descriptor for stdout but it turns out that
      exec was a culprit. For some reason a call to exec truncates (or at
      least removes unfinished line) from stdout. I have no idea why it
      behaves that way but adding flush just after callback (before exec)
      solves that problem and allows us to correctly use print in callback.
      The weird part is that the same thing does not happen with stderr but
      non the less I also added flush for it.
      8502ac4b
    • Karel Koci's avatar
      subprocess: mark some arguments as not possible to be NULL · a803ad41
      Karel Koci authored
      This also removes possibly hack to run C/Lua code in subprocess without
      providing command. It is overhead but it is more systematic to use
      'true' as a command instead of possibly in code unexpected value NULL.
      a803ad41
    • Karel Koci's avatar
      subprocess: Use BUFSIZ in pipes read · 5a09ba46
      Karel Koci authored
      Instead of pretty small constant lets use system level compilation
      constant BUFSIZ. Thanks to that we should have buffer exactly matched to
      stdio buffer which should somewhat ensure better performance. It is
      minor thing but it is better to do it non the less.
      5a09ba46
    • Karel Koci's avatar
      subprocess: Increase logging about executed processes to debug · dc1bce93
      Karel Koci authored
      This also adds message about termination of subprocess.
      dc1bce93
    • Karel Koci's avatar
      logging: drop unneeded exit code · 48f9ef06
      Karel Koci authored
      I probably had some plan with it but I no longer remember what it was
      suppose to been. Instead I just drop it here. It can be reverted later
      if needed.
      
      This also correctly sets read field for cookie structure. This has no
      effect because we are not reading from it but just to be precise with
      our code we set it to know value NULL which means that read is not
      available.
      48f9ef06
  9. 11 Dec, 2018 11 commits