boot: revert boot related globalvars after booting
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected] change-id 20261030-boot-globalvar-stack-9c65609b5801Versions newest first
- v2 Latest9 patches 1 replyApplied
- v110 patches 13 repliesSuperseded
Changes in v2 from the cover letter
- globalvar scopes take fnmatch() patterns instead of name prefixes
- "boot: revert globalvar changes after each boot entry": use
global.bootm.earlycon instead of global.bootm.tee as example
- "test: py: add test for reverting globalvars after boot": fix line
break in commit message
- "of: add watchdog bootarg directly instead of via a globalvar": drop
the legacy bootargs fallback from the commit message, it is gone in
next
- Drop "boot: drop the dyn infix from the bootentries bootargs variable",
blspec and extlinux keep using global.linux.bootargs.dyn.bootentries
so their options don't move in the Kernel command line
- Migration guide: describe that global.linux.bootargs.dyn.* set before
calling boot is now kept, and that blspec and extlinux keep the .dyn
infix
- Link to v1: https://lore.barebox.org/[email protected]
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | globalvar: add scopes to snapshot and restore globalvarscommon/ include/ | +172 | 0 replies | |
| 2/9 | bootm: revert globalvar changes in bootm_boot_cleanup()common/ include/ include/ | +27 | 0 replies | |
| 3/9 | boot: revert globalvar changes after each boot entryDocumentation/ Documentation/ common/ +2 more | +24 | 0 replies | |
| 4/9 | bootchooser: use a globalvar scope for its bootargscommon/ | +5 | 0 replies | |
| 5/9 | test: py: add test for reverting globalvars after boottest/ | +117 | 0 replies | |
| 6/9 | bootargs: remove unused linux_bootargs_overwrite()common/ include/ | +0 | 0 replies | |
| 7/9 | of: add watchdog bootarg directly instead of via a globalvarDocumentation/ common/ common/ | +28 | 0 replies | |
| 8/9 | defaultenv: don't use global.linux.bootargs.dyn.* in boot entriesDocumentation/ defaultenv/ defaultenv/ +1 more | +9 | 0 replies | |
| 9/9 | Documentation: migration-guides: describe reverting boot globalvarsDocumentation/ | +19 | 0 replies |
Reviews trailers per patch
7 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Ahmad Fatoum |
|---|---|
| 1/9 | |
| 2/9 | |
| 3/9 | R-b |
| 4/9 | R-b |
| 5/9 | A-b |
| 6/9 | R-b |
| 7/9 | R-b |
| 8/9 | R-b |
| 9/9 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/9] boot: revert boot related globalvars after booting
Boot entries configure booting through globalvars like global.bootm.*, global.linux.bootargs.* or global.of.overlay.*. So far only some of these were restored after a boot entry returned, by saving a fixed set of variables and by clearing the global.linux.bootargs.dyn.* namespace.
This series adds globalvar scopes, which snapshot all globalvars matching given patterns and restore them later, and uses them around each boot entry, bootm and bootchooser boot attempts. With that the .dyn infix is no longer needed, so it is dropped from the boot scripts of the default environment. blspec and extlinux keep using global.linux.bootargs.dyn.bootentries, so the position of their options in the Kernel command line doesn't change.
The series is based on the "boot: UAF and double free fixes" series.
To: open list:BAREBOX <[email protected]>
Changes in v2:
- globalvar scopes take fnmatch() patterns instead of name prefixes
- "boot: revert globalvar changes after each boot entry": use
global.bootm.earlycon instead of global.bootm.tee as example
- "test: py: add test for reverting globalvars after boot": fix line
break in commit message
- "of: add watchdog bootarg directly instead of via a globalvar": drop
the legacy bootargs fallback from the commit message, it is gone in
next
- Drop "boot: drop the dyn infix from the bootentries bootargs variable",
blspec and extlinux keep using global.linux.bootargs.dyn.bootentries
so their options don't move in the Kernel command line
- Migration guide: describe that global.linux.bootargs.dyn.* set before
calling boot is now kept, and that blspec and extlinux keep the .dyn
infix
- Link to v1: https://lore.barebox.org/[email protected]
---
Sascha Hauer (9):
globalvar: add scopes to snapshot and restore globalvars
bootm: revert globalvar changes in bootm_boot_cleanup()
boot: revert globalvar changes after each boot entry
bootchooser: use a globalvar scope for its bootargs
test: py: add test for reverting globalvars after boot
bootargs: remove unused linux_bootargs_overwrite()
of: add watchdog bootarg directly instead of via a globalvar
defaultenv: don't use global.linux.bootargs.dyn.* in boot entries
Documentation: migration-guides: describe reverting boot globalvars
.../migration-master/boot-globalvar-scope.rst | 19 +++ Documentation/user/booting-linux.rst | 27 ++-- Documentation/user/devboot.rst | 4 +- common/Kconfig | 6 +- common/boot.c | 35 ++--- common/bootargs.c | 17 --- common/bootchooser.c | 6 +- common/bootm.c | 27 +--- common/globalvar.c | 143 +++++++++++++++++++++ common/oftree.c | 41 +++--- defaultenv/defaultenv-2-base/boot/net | 5 +- defaultenv/defaultenv-2-base/data/boot-template | 2 +- defaultenv/defaultenv-2-dfu/boot/dfu | 4 +- include/boot.h | 16 +++ include/bootargs.h | 5 - include/bootm.h | 9 +- include/globalvar.h | 29 +++++ test/py/test_boot_globalvar_scope.py | 117 +++++++++++++++++ 18 files changed, 401 insertions(+), 111 deletions(-)
---
base-commit: db380db7a86026f0b19ea6841fa9b9f5326a4b0b
change-id: 20261030-boot-globalvar-stack-9c65609b5801
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>