Skip to content
Snippets Groups Projects
Select Git revision
  • 4511da0aee68a215b350f2035d198667703f2f4f
  • v2018.2.x default
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
42 results

upgrade.rst

Blame
  • Forked from firmware / FFS Gluon
    3847 commits behind the upstream repository.
    user avatar
    kb-light authored
    4511da0a
    History
    upgrade.rst 2.06 KiB

    Upgrade scripts

    Basics

    After each sysupgrade (including the initial installation), Gluon will execute all scripts under /lib/gluon/upgrade. These scripts' filenames usually begin with a 3-digit number specifying the order of execution.

    To get an overview of the ordering of all scripts of all packages, the helper script contrib/lsupgrade.sh in the Gluon repository can be used, which will print all upgrade scripts' filenames and directories. If executed on a TTY, the filename will be highlighted in green, the repository in blue and the package in red.

    Best practices

    • Most upgrade scripts are written in Lua. This allows using lots of helper functions provided by LuCi and Gluon, e.g. to access the site configuration or edit UCI configuration files.
    • Whenever possible, scripts shouldn't check if they are running for the first time, but just edit configuration files to achive a valid configuration (without overwriting configuration changes made by the user where desirable). This allows using the same code to create the initial configuration and upgrade configurations on upgrades.
    • If it is unavoidable to run different code during the initial installation, the sysconfig.gluon_version variable can be checked. This variable is nil during the initial installation and contains the previously install Gluon version otherwise. The package gluon-legacy (which is responsible for upgrades from the old firmwares of Hamburg/Kiel/Lübeck) uses the special value legacy; other packages should handle this value just as any other string.

    Script ordering

    These are some guidelines for the script numbers:

    • 0xx: Basic sysconfig setup
    • 1xx: Basic system setup (including basic network configuration)
    • 2xx: Wireless setup
    • 3xx: Advanced network and system setup
    • 4xx: Extended network and system setup (e.g. mesh VPN and next-node)
    • 5xx: Miscellaneous (everything not fitting into any other category)
    • 6xx .. 8xx: Currently unused
    • 9xx: Upgrade finalization