Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
darkbit
ffbs-gluon
Commits
4c8866ff
Commit
4c8866ff
authored
10 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
Documentation and helper script for the new upgrade script handling
parent
be19251c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/lsupgrade.sh
+44
-0
44 additions, 0 deletions
contrib/lsupgrade.sh
docs/dev/upgrade.rst
+43
-0
43 additions, 0 deletions
docs/dev/upgrade.rst
docs/index.rst
+1
-0
1 addition, 0 deletions
docs/index.rst
with
88 additions
and
0 deletions
contrib/lsupgrade.sh
0 → 100755
+
44
−
0
View file @
4c8866ff
#!/bin/bash
# Script to list all upgrade scripts in a clear manner
# Limitations:
# * Does only show scripts of packages whose `files' directory represent the whole image filesystem (which are all Gluon packages)
SUFFIX
=
files/lib/gluon/upgrade
shopt
-s
nullglob
if
tty
-s
<&1
;
then
RED
=
"
$(
echo
-e
'\x1b[01;31m'
)
"
GREEN
=
"
$(
echo
-e
'\x1b[01;32m'
)
"
BLUE
=
"
$(
echo
-e
'\x1b[01;34m'
)
"
RESET
=
"
$(
echo
-e
'\x1b[0m'
)
"
else
RED
=
GREEN
=
BLUE
=
RESET
=
fi
pushd
"
$(
dirname
"
$0
"
)
/.."
>
/dev/null
find packages
-name
Makefile |
while
read
makefile
;
do
dir
=
"
$(
dirname
"
$makefile
"
)
"
pushd
"
$dir
"
>
/dev/null
repo
=
"
$(
dirname
"
$dir
"
|
cut
-d
/
-f
2
)
"
dirname
=
"
$(
dirname
"
$dir
"
|
cut
-d
/
-f
3-
)
"
package
=
"
$(
basename
"
$dir
"
)
"
for
file
in
"
${
SUFFIX
}
"
/
*
;
do
echo
"
${
GREEN
}
$(
basename
"
${
file
}
"
)
${
RESET
}
"
"(
${
BLUE
}${
repo
}${
RESET
}
/
${
dirname
}
/
${
RED
}${
package
}${
RESET
}
/
${
SUFFIX
}
)"
done
popd
>
/dev/null
done
|
sort
popd
>
/dev/null
This diff is collapsed.
Click to expand it.
docs/dev/upgrade.rst
0 → 100644
+
43
−
0
View file @
4c8866ff
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 in ``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
This diff is collapsed.
Click to expand it.
docs/index.rst
+
1
−
0
View file @
4c8866ff
...
...
@@ -36,6 +36,7 @@ Developer Documentation
dev/basics
dev/hardware
dev/upgrade
dev/configmode
Supported Devices
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment