2014-05-24 19:49:55 +00:00
|
|
|
Autoupdater
|
|
|
|
===========
|
|
|
|
|
2014-07-09 10:43:10 +00:00
|
|
|
Gluon contains an automatic update system which can be configured in the site configuration.
|
|
|
|
|
|
|
|
Building Images
|
|
|
|
---------------
|
|
|
|
|
|
|
|
By default, the autoupdater is disabled (as it is usually not helpful to have unexpected updates
|
2020-07-04 10:38:01 +00:00
|
|
|
during development), but it can be enabled by setting the variable ``GLUON_AUTOUPDATER_ENABLED`` to ``1`` when building.
|
|
|
|
It is also possible to override the default branch during build using the variable ``GLUON_AUTOUPDATER_BRANCH``.
|
|
|
|
|
|
|
|
If a default branch is set neither in *site.conf* nor via ``GLUON_AUTOUPDATER_BRANCH``, the default branch is
|
|
|
|
implementation-defined. Currently, the branch with the first name in alphabetical order is chosen.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
|
|
|
A manifest file for the updater can be generated with `make manifest`. A signing script (using
|
2018-10-24 20:06:11 +00:00
|
|
|
``ecdsautils``) can be found in the `contrib` directory. When creating the manifest, the
|
2016-10-20 06:59:39 +00:00
|
|
|
``PRIORITY`` value may be defined by setting ``GLUON_PRIORITY`` on the command line or in ``site.mk``.
|
2014-07-20 20:36:46 +00:00
|
|
|
|
2016-10-20 06:59:39 +00:00
|
|
|
``GLUON_PRIORITY`` defines the maximum number of days that may pass between releasing an update and installation
|
|
|
|
of the images. The update probability will start at 0 after the release time declared in the manifest file
|
|
|
|
by the variable DATE and then slowly rise up to 1 when ``GLUON_PRIORITY`` days have passed. The autoupdater checks
|
|
|
|
for updates hourly (at a random minute of the hour), but usually only updates during its run between
|
|
|
|
4am and 5am, except when the whole ``GLUON_PRIORITY`` days and another 24 hours have passed.
|
2014-07-20 20:36:46 +00:00
|
|
|
|
2016-10-20 06:59:39 +00:00
|
|
|
``GLUON_PRIORITY`` may be an integer or a decimal fraction.
|
|
|
|
|
2017-08-17 16:09:59 +00:00
|
|
|
If ``GLUON_RELEASE`` is passed to ``make`` explicitly or it is generated dynamically
|
|
|
|
in ``site.mk``, care must be taken to pass the same ``GLUON_RELEASE`` to ``make manifest``,
|
|
|
|
as otherwise the generated manifest will be incomplete.
|
|
|
|
|
|
|
|
|
2016-10-20 06:59:39 +00:00
|
|
|
Automated nightly builds
|
|
|
|
------------------------
|
2014-07-09 10:43:10 +00:00
|
|
|
|
|
|
|
A fully automated nightly build could use the following commands:
|
|
|
|
|
2020-07-04 10:38:01 +00:00
|
|
|
.. code-block:: sh
|
2014-07-09 10:43:10 +00:00
|
|
|
|
|
|
|
git pull
|
2020-07-04 10:38:01 +00:00
|
|
|
# git -C site pull
|
2014-07-09 10:43:10 +00:00
|
|
|
make update
|
2018-10-24 20:06:11 +00:00
|
|
|
make clean GLUON_TARGET=ar71xx-generic
|
2016-10-20 14:44:04 +00:00
|
|
|
NUM_CORES_PLUS_ONE=$(expr $(nproc) + 1)
|
2020-07-04 10:38:01 +00:00
|
|
|
make -j$NUM_CORES_PLUS_ONE GLUON_TARGET=ar71xx-generic GLUON_RELEASE=$GLUON_RELEASE \
|
|
|
|
GLUON_AUTOUPDATER_BRANCH=experimental GLUON_AUTOUPDATER_ENABLED=1
|
|
|
|
make manifest GLUON_RELEASE=$GLUON_RELEASE GLUON_AUTOUPDATER_BRANCH=experimental
|
2015-10-12 23:18:03 +00:00
|
|
|
contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest
|
2014-07-26 00:20:38 +00:00
|
|
|
|
|
|
|
rm -rf /where/to/put/this/experimental
|
2015-10-12 23:18:03 +00:00
|
|
|
cp -r output/images /where/to/put/this/experimental
|
2014-07-09 10:43:10 +00:00
|
|
|
|
|
|
|
|
2014-05-24 19:49:55 +00:00
|
|
|
Infrastructure
|
|
|
|
--------------
|
|
|
|
|
|
|
|
We suggest to have following directory tree accessible via http:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
firmware/
|
|
|
|
stable/
|
|
|
|
sysupgrade/
|
|
|
|
factory/
|
|
|
|
snapshot/
|
|
|
|
sysupgrade/
|
|
|
|
factory/
|
|
|
|
experimental/
|
|
|
|
sysupgrade/
|
|
|
|
factory/
|
|
|
|
|
2015-05-11 14:26:06 +00:00
|
|
|
The server must be available via IPv6.
|
2014-05-24 19:49:55 +00:00
|
|
|
|
|
|
|
Command Line
|
|
|
|
------------
|
|
|
|
|
2016-01-14 01:46:29 +00:00
|
|
|
These commands can be used on a node:
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2014-05-24 19:49:55 +00:00
|
|
|
::
|
|
|
|
|
|
|
|
# Update with some probability
|
2014-08-18 10:47:47 +00:00
|
|
|
autoupdater
|
2014-05-24 19:49:55 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2014-07-20 20:36:46 +00:00
|
|
|
# Force update check, even when the updater is disabled
|
2014-05-24 19:49:55 +00:00
|
|
|
autoupdater -f
|
2016-10-20 06:59:39 +00:00
|
|
|
|
2016-05-26 14:46:32 +00:00
|
|
|
::
|
|
|
|
|
2017-09-06 16:24:03 +00:00
|
|
|
# If fallback is true the updater will perform an update only if the timespan
|
2016-10-20 06:59:39 +00:00
|
|
|
# PRIORITY days (as defined in the manifest) and another 24h have passed
|
2016-05-26 14:46:32 +00:00
|
|
|
autoupdater --fallback
|