autoupdater.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. If ``GLUON_RELEASE`` is passed to ``make`` explicitly or it is generated dynamically
  19. in ``site.mk``, care must be taken to pass the same ``GLUON_RELEASE`` to ``make manifest``,
  20. as otherwise the generated manifest will be incomplete.
  21. Automated nightly builds
  22. ------------------------
  23. A fully automated nightly build could use the following commands:
  24. ::
  25. git pull
  26. (cd site && git pull)
  27. make update
  28. make clean
  29. NUM_CORES_PLUS_ONE=$(expr $(nproc) + 1)
  30. make -j$NUM_CORES_PLUS_ONE GLUON_TARGET=ar71xx-generic GLUON_BRANCH=experimental
  31. make manifest GLUON_BRANCH=experimental
  32. contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest
  33. rm -rf /where/to/put/this/experimental
  34. cp -r output/images /where/to/put/this/experimental
  35. Infrastructure
  36. --------------
  37. We suggest to have following directory tree accessible via http:
  38. ::
  39. firmware/
  40. stable/
  41. sysupgrade/
  42. factory/
  43. snapshot/
  44. sysupgrade/
  45. factory/
  46. experimental/
  47. sysupgrade/
  48. factory/
  49. The server must be available via IPv6.
  50. Command Line
  51. ------------
  52. These commands can be used on a node:
  53. ::
  54. # Update with some probability
  55. autoupdater
  56. ::
  57. # Force update check, even when the updater is disabled
  58. autoupdater -f
  59. ::
  60. # If fallback is true the updater will perform an update only if the timespan
  61. # PRIORITY days (as defined in the manifest) and another 24h have passed
  62. autoupdater --fallback