summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-05-11 10:33:48 -0500
committerGitHub <noreply@github.com>2024-05-11 10:33:48 -0500
commit61e1a6deb405c5550d52642fb879260b40340824 (patch)
tree75c254ab13d98dc9b8cf830408ffc6b667cbfc98
parent31d06a863901715bfc2503e2312aeb03917360af (diff)
parentd294087ac5bf4ebad9a6c6d018ce6e9ed93a47cf (diff)
downloadvyos-1x-61e1a6deb405c5550d52642fb879260b40340824.tar.gz
vyos-1x-61e1a6deb405c5550d52642fb879260b40340824.zip
Merge pull request #3446 from vyos/mergify/bp/sagitta/pr-3445
image-tools: T6176: addendum to fixes for boot console (backport #3445)
-rw-r--r--python/vyos/system/compat.py8
-rwxr-xr-xsrc/op_mode/image_installer.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py
index 94e40d268..d35bddea2 100644
--- a/python/vyos/system/compat.py
+++ b/python/vyos/system/compat.py
@@ -247,6 +247,10 @@ def update_version_list(root_dir: str = '') -> list[dict]:
menu_entries = parse_menuentries(grub_cfg_main)
menu_versions = find_versions(menu_entries)
+ # remove deprecated console-type ttyUSB
+ menu_entries = list(filter(lambda x: x.get('console_type') != 'ttyUSB',
+ menu_entries))
+
# get list of versions added/removed by image-tools
current_versions = grub.version_list(root_dir)
@@ -262,9 +266,7 @@ def update_version_list(root_dir: str = '') -> list[dict]:
add = list(set(current_versions) - set(menu_versions))
for ver in add:
last = menu_entries[0].get('version')
- # copy legacy format of menu entries; ignore deprecated ttyUSB
- new = deepcopy(list(filter(lambda x: (x.get('version') == last and
- x.get('console_type') != 'ttyUSB'),
+ new = deepcopy(list(filter(lambda x: x.get('version') == last,
menu_entries)))
for e in new:
boot_opts = grub.get_boot_opts(ver)
diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py
index d65cd6b1d..34afad365 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -675,7 +675,7 @@ def install_image() -> None:
# ask for default console
console_type: str = ask_input(MSG_INPUT_CONSOLE_TYPE,
- default='K',
+ default=console_hint(),
valid_responses=['K', 'S'])
console_dict: dict[str, str] = {'K': 'tty', 'S': 'ttyS'}