Skip to content

image-tools: T6176: addendum to fixes for boot console (backport #3445) #3446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/vyos/system/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/op_mode/image_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}

Expand Down