summaryrefslogtreecommitdiff
path: root/python/vyos/system/compat.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-01-30 08:29:58 -0600
committerGitHub <noreply@github.com>2024-01-30 08:29:58 -0600
commit8bd6c24b50a34225763058c1daa28c8a8fe59098 (patch)
tree211c13a3df56abe246d556eaf04d8208d12b5af4 /python/vyos/system/compat.py
parent02f7f91e3937f1622ba055847aa96b207d5ba754 (diff)
parent287c3edbac7f308d3240bdec253f0e5103e8eca1 (diff)
downloadvyos-1x-8bd6c24b50a34225763058c1daa28c8a8fe59098.tar.gz
vyos-1x-8bd6c24b50a34225763058c1daa28c8a8fe59098.zip
Merge pull request #2888 from vyos/mergify/bp/sagitta/pr-2886
system-option: T5979: Add configurable kernel boot options (backport #2886)
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 cc0529b91..37b834ad6 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
@@ -249,13 +249,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