T8445: T8335: Extend config activation system#5096
T8445: T8335: Extend config activation system#5096jestabro wants to merge 13 commits intovyos:currentfrom
Conversation
|
👍 |
c4aac5b to
d221a6b
Compare
There was a problem hiding this comment.
Pull request overview
Extends the config activation system to support per-script activation state (persistent/once/off) and adds an op-mode interface for viewing and controlling activation scripts, aiming to avoid overwriting user config while still performing needed first-boot adjustments.
Changes:
- Add an activation-list mechanism (generated at build time) plus runtime utilities to read/update activation state.
- Update the activation runner to execute only active scripts and support optional
pre_condition/post_conditionhooks and one-shot deactivation. - Add new activation scripts to detect first installed boot and set config path hints; adjust ethernet offload activation behavior accordingly.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/op_mode/activation.py |
New op-mode command implementation for listing/showing scripts and setting activation state |
src/helpers/run-config-activation.py |
Runner now consults activation state and supports pre/post hooks + once semantics |
src/activation-scripts/example.py |
Example template for activation script structure and optional hooks |
src/activation-scripts/20-ethernet-offload.py |
Adds post-condition to disable after first installed boot; adjusts live-boot gating behavior |
src/activation-scripts/01-set-config-path-hint.py |
New script to set config path hint on first installed boot |
src/activation-scripts/00-first-installed-boot.py |
New script to mark first installed boot and disable itself |
scripts/generate-activation-scripts-json.py |
Build-time generator for default activation-list from activation scripts directory |
python/vyos/utils/func.py |
Adds FalseCallable helper for optional hook defaults |
python/vyos/utils/activate.py |
New shared utilities for activation-list access + first-boot/config-hint helpers |
python/vyos/defaults.py |
Adds activation_list path default |
op-mode-definitions/terminal.xml.in |
Adjusts help text for set node |
op-mode-definitions/system-image.xml.in |
Adjusts help text for set node |
op-mode-definitions/system-activation.xml.in |
New op-mode definitions for show system activation / set system activation |
debian/vyos-1x.postinst |
Initializes activation-list in config dir on install |
Makefile |
Runs activation-list generator as part of make all |
.gitignore |
Ignores generated data/activation-list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bddce67 to
aac7186
Compare
|
Updates to address the legitimate point caught by copilot: for (1) package update on a live system or (2) system image update, one needs to conservatively update the activation-list. This is handled by an install script in vyos-1x.postinst, respectively, a check on reboot after a system update. There is intended redundancy in code for the two cases, as we do not want a library function in postinst, but do in the activation script runner. |
|
Note that all linters pass in local tests; it is unclear as to the source of the listed linter failure. |
|
Move to draft to distinguish default settings on image installation vs image upgrade. |
aac7186 to
8ef264a
Compare
|
Rebased over current, before adding updates to PR. |
8ef264a to
ce36c09
Compare
ce36c09 to
717d0d3
Compare
This is useful as default value for a getattr of a function from a module.
Without establishing consistency for those scripts that include a help message for 'set', one will still see that of system-image.xml.in: "Install a new system" Replace with a general message.
Add script to leave hint of first installed boot (as, say, distinguished from first live boot, or subsequent); this is useful as pre/post conditions and self-modification of activation scripts.
This is necessary for images produced from a raw_image build (qcow2), which no longer make use of the image_installer script.
Use refined activation tools for correct behavior on first installed boot.
717d0d3 to
21f1e42
Compare
21f1e42 to
81227c0
Compare
|
Build failure above is an artifact of the recent change to workflow; vyos-build branch found, but does not pull correct branch within build-vyos-image, here: |
81227c0 to
6c4122f
Compare
|
Added temp workaround to draft PR vyos/vyos-build#1156 to correct workflow issue mentioned above. |
|
CI integration 👍 passed! Details
|
Change summary
The introduction of the config activation system was critical to resolving several issues of the migration system (T6006) but lacked flexibility. Extend to be (1) useful for additional scripts (2) correct for existing script.
Regarding (1), scripts were all or nothing, hence user modifications to config stanzas governed by an activation script would be overwritten on a subsequent boot, leading to (2) workarounds such as #4077, which is incorrect in the case of a raw image build.
After this PR is merged, vyos/vyos-build#1156 will be needed for application to images built with
create_raw_image.Types of changes
Related Task(s)
Related PR(s)
How to test / Smoketest result
This is an extension of internal tools, however, one can see that (1) a fix for T6716 is preserved, yet (2) ethernet offload capabilities are correctly detected for systems booted from qcow2 images (3) T8335 is now correct (detection of previous installations from qcow2 images).
Checklist: