autoupdater.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. Autoupdater
  2. ===========
  3. Gluon contains an automatic update system which can be configured in the site configuration.
  4. Building Images
  5. ---------------
  6. By default, the autoupdater is disabled (as it is usually not helpful to have unexpected updates
  7. during development), but it can be enabled by setting the variable GLUON_BRANCH when building
  8. to override the default branch set in the set in the site configuration.
  9. A manifest file for the updater can be generated with `make manifest`. A signing script (using
  10. ``ecdsautils``) can by found in the `contrib` directory. When creating the manifest, the
  11. ``PRIORITY`` value may be defined by setting ``GLUON_PRIORITY`` on the command line or in ``site.mk``.
  12. ``GLUON_PRIORITY`` defines the maximum number of days that may pass between releasing an update and installation
  13. of the images. The update probability will start at 0 after the release time declared in the manifest file
  14. by the variable DATE and then slowly rise up to 1 when ``GLUON_PRIORITY`` days have passed. The autoupdater checks
  15. for updates hourly (at a random minute of the hour), but usually only updates during its run between
  16. 4am and 5am, except when the whole ``GLUON_PRIORITY`` days and another 24 hours have passed.
  17. ``GLUON_PRIORITY`` may be an integer or a decimal fraction.
  18. Automated nightly builds
  19. ------------------------
  20. A fully automated nightly build could use the following commands:
  21. ::
  22. git pull
  23. (cd site && git pull)
  24. make update
  25. make clean
  26. NUM_CORES_PLUS_ONE=$(expr $(nproc) + 1)
  27. make -j$NUM_CORES_PLUS_ONE GLUON_TARGET=ar71xx-generic GLUON_BRANCH=experimental
  28. make manifest GLUON_BRANCH=experimental
  29. contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest
  30. rm -rf /where/to/put/this/experimental
  31. cp -r output/images /where/to/put/this/experimental
  32. Infrastructure
  33. --------------
  34. We suggest to have following directory tree accessible via http:
  35. ::
  36. firmware/
  37. stable/
  38. sysupgrade/
  39. factory/
  40. snapshot/
  41. sysupgrade/
  42. factory/
  43. experimental/
  44. sysupgrade/
  45. factory/
  46. The server must be available via IPv6.
  47. Command Line
  48. ------------
  49. These commands can be used on a node:
  50. ::
  51. # Update with some probability
  52. autoupdater
  53. ::
  54. # Force update check, even when the updater is disabled
  55. autoupdater -f
  56. ::
  57. # If fallback is true the updater will perform an update only if the timespan
  58. # PRIORITY days (as defined in the manifest) and another 24h have passed
  59. autoupdater --fallback