summaryrefslogtreecommitdiff
path: root/python/vyos/system/compat.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-01-22 21:01:00 -0600
committerJohn Estabrook <jestabro@vyos.io>2024-01-23 10:32:15 -0600
commit1b1569d5b88a20994fc65fd529f8103db371bf3f (patch)
treef661f4782f27c9ea03c49fcabe288e4e361cc4bd /python/vyos/system/compat.py
parent4c2d4519277bc4cbe964a37160b93c31cdc77309 (diff)
downloadvyos-1x-1b1569d5b88a20994fc65fd529f8103db371bf3f.tar.gz
vyos-1x-1b1569d5b88a20994fc65fd529f8103db371bf3f.zip
image-tools: T5980: add support for configurable kernel boot options
Diffstat (limited to 'python/vyos/system/compat.py')
-rw-r--r--python/vyos/system/compat.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py
index 436da14e8..626ce0067 100644
--- a/python/vyos/system/compat.py
+++ b/python/vyos/system/compat.py
@@ -1,4 +1,4 @@
-# Copyright 2023 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2023-2024 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -246,13 +246,17 @@ def update_version_list(root_dir: str = '') -> list[dict]:
menu_entries = list(filter(lambda x: x.get('version') != ver,
menu_entries))
+ # reset boot_opts in case of config update
+ for entry in menu_entries:
+ entry['boot_opts'] = grub.get_boot_opts(entry['version'])
+
add = list(set(current_versions) - set(menu_versions))
for ver in add:
last = menu_entries[0].get('version')
new = deepcopy(list(filter(lambda x: x.get('version') == last,
menu_entries)))
for e in new:
- boot_opts = e.get('boot_opts').replace(last, ver)
+ boot_opts = grub.get_boot_opts(ver)
e.update({'version': ver, 'boot_opts': boot_opts})
menu_entries = new + menu_entries