From ecee10d0512daff3034499d1163463d1390e35d4 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 10 May 2024 14:31:50 -0500 Subject: image-tools: T6327: prune, instead of ignore, menu entries with ttyUSB --- python/vyos/system/compat.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 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) -- cgit v1.2.3 From 0eb09b81f763a62684a7be905267f081f9d6aeb1 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 10 May 2024 14:33:40 -0500 Subject: image-tools: T6176: use console_hint as default --- src/op_mode/image_installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py index 22bdc26fb..0d2d7076c 100755 --- a/src/op_mode/image_installer.py +++ b/src/op_mode/image_installer.py @@ -725,7 +725,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'} -- cgit v1.2.3