summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-09 14:34:24 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-12-16 20:37:10 -0600
commita1476c24fb549aaf2702f1c9e2383b3eb90bc6ee (patch)
tree3c906dadfbfc1c3d3b072cef2140fbc8a903ff9a /src
parenta41d2c01295bed792c376aa817ac06365cc8a7a5 (diff)
downloadvyos-1x-a1476c24fb549aaf2702f1c9e2383b3eb90bc6ee.tar.gz
vyos-1x-a1476c24fb549aaf2702f1c9e2383b3eb90bc6ee.zip
image: T4516: ensure compatibility with legacy RAID 1 installs
(cherry picked from commit bd701768796d6ebb03ca943faf96d1dbea030edd)
Diffstat (limited to 'src')
-rw-r--r--src/system/grub_update.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/system/grub_update.py b/src/system/grub_update.py
index da1986e9d..366a85344 100644
--- a/src/system/grub_update.py
+++ b/src/system/grub_update.py
@@ -55,7 +55,10 @@ if __name__ == '__main__':
vyos_menuentries = compat.parse_menuentries(grub_cfg_main)
vyos_versions = compat.find_versions(vyos_menuentries)
unparsed_items = compat.filter_unparsed(grub_cfg_main)
-
+ # compatibilty for raid installs
+ search_root = compat.get_search_root(unparsed_items)
+ common_dict = {}
+ common_dict['search_root'] = search_root
# find default values
default_entry = vyos_menuentries[int(vars['default'])]
default_settings = {
@@ -66,11 +69,6 @@ if __name__ == '__main__':
}
vars.update(default_settings)
- # print(f'vars: {vars}')
- # print(f'modules: {modules}')
- # print(f'vyos_menuentries: {vyos_menuentries}')
- # print(f'unparsed_items: {unparsed_items}')
-
# create new files
grub_cfg_vars = f'{root_dir}/{grub.CFG_VYOS_VARS}'
grub_cfg_modules = f'{root_dir}/{grub.CFG_VYOS_MODULES}'
@@ -81,8 +79,7 @@ if __name__ == '__main__':
Path(image.GRUB_DIR_VYOS).mkdir(exist_ok=True)
grub.vars_write(grub_cfg_vars, vars)
grub.modules_write(grub_cfg_modules, modules)
- # Path(grub_cfg_platform).write_text(unparsed_items)
- grub.common_write()
+ grub.common_write(grub_common=common_dict)
render(grub_cfg_menu, grub.TMPL_GRUB_MENU, {})
render(grub_cfg_options, grub.TMPL_GRUB_OPTS, {})