diff options
author | Christian Breunig <christian@breunig.cc> | 2025-04-15 20:47:09 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-04-15 20:55:03 +0200 |
commit | 3fe5f8fb95a444ecb5b8489736a2e33419746f93 (patch) | |
tree | 99f41e42672fba3d94b3eaf25196ee7ce8c3d530 /python | |
parent | a0861b6b44c3a7cfbbefa2e8187443f06028a360 (diff) | |
download | vyos-1x-3fe5f8fb95a444ecb5b8489736a2e33419746f93.tar.gz vyos-1x-3fe5f8fb95a444ecb5b8489736a2e33419746f93.zip |
grub: T7327: honor "system option kernel" settings during image upgrade
When performing an image upgrade and Linux Kernel command-line option that
should be passed via GRUB to the Linux Kernel are missing on the first boot.
This is because when generating the GRUB command-line via the op-mode scripts
the CLI nodes defining the options are not honored.
This commit re-implements the code-path in op-mode which generates the strings
passed via GRUB to the Linux Kernel command-line.
NOTE: If (for a yet unknown reason) a Kernel command-line option string changes
during a major - or minor - upgrade of the Linux Kernel, we will need to adapt
that logic and possibly call a helper from within the NEW updated image rootfs.
Thus we can ship future information back into the past like the "Grays Sports
Almanac" from Back to the Future Part II.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/system/grub_util.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/python/vyos/system/grub_util.py b/python/vyos/system/grub_util.py index 4a3d8795e..ad95bb4f9 100644 --- a/python/vyos/system/grub_util.py +++ b/python/vyos/system/grub_util.py @@ -56,13 +56,12 @@ def set_kernel_cmdline_options(cmdline_options: str, version: str = '', @image.if_not_live_boot def update_kernel_cmdline_options(cmdline_options: str, - root_dir: str = '') -> None: + root_dir: str = '', + version = image.get_running_image()) -> None: """Update Kernel custom cmdline options""" if not root_dir: root_dir = disk.find_persistence() - version = image.get_running_image() - boot_opts_current = grub.get_boot_opts(version, root_dir) boot_opts_proposed = grub.BOOT_OPTS_STEM + f'{version} {cmdline_options}' |