diff options
author | John Estabrook <jestabro@vyos.io> | 2024-05-10 14:31:50 -0500 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-05-11 05:21:30 +0000 |
commit | 5fbc4dfb37f387012fc2cacd8879ccfe89342d4a (patch) | |
tree | 91e3c6a778cf715bcf50a175300f768a6e2b52e7 /python/vyos/system/compat.py | |
parent | 31d06a863901715bfc2503e2312aeb03917360af (diff) | |
download | vyos-1x-5fbc4dfb37f387012fc2cacd8879ccfe89342d4a.tar.gz vyos-1x-5fbc4dfb37f387012fc2cacd8879ccfe89342d4a.zip |
image-tools: T6327: prune, instead of ignore, menu entries with ttyUSB
(cherry picked from commit ecee10d0512daff3034499d1163463d1390e35d4)
Diffstat (limited to 'python/vyos/system/compat.py')
-rw-r--r-- | python/vyos/system/compat.py | 8 |
1 files 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) |