summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-05-10 08:31:15 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-05-10 08:32:52 -0500
commit32658e981babffb5b7149534bd50a64d11f7c74f (patch)
tree23007ab232d4887e2ab3ec5285246393b846cd17
parentdef74a8fa4e0fb9c7ef95bfb6daff8a4f1a9878f (diff)
downloadvyos-1x-32658e981babffb5b7149534bd50a64d11f7c74f.tar.gz
vyos-1x-32658e981babffb5b7149534bd50a64d11f7c74f.zip
image-tools: T6327: drop boot console type ttyUSB
-rw-r--r--data/templates/grub/grub_compat.j24
-rw-r--r--data/templates/grub/grub_options.j26
-rw-r--r--python/vyos/system/compat.py10
-rwxr-xr-xsrc/op_mode/image_installer.py6
4 files changed, 6 insertions, 20 deletions
diff --git a/data/templates/grub/grub_compat.j2 b/data/templates/grub/grub_compat.j2
index d1085eec8..8fb4f71dc 100644
--- a/data/templates/grub/grub_compat.j2
+++ b/data/templates/grub/grub_compat.j2
@@ -14,8 +14,6 @@
KVM
{%- elif type == 'ttyS' -%}
Serial
-{%- elif type == 'ttyUSB' -%}
- USB
{%- else -%}
Unknown
{%- endif %}
@@ -25,8 +23,6 @@
console=ttyS0,{{ console_speed }} console=tty0
{%- elif type == 'ttyS' -%}
console=tty0 console=ttyS0,{{ console_speed }}
-{%- elif type == 'ttyUSB' -%}
- console=tty0 console=ttyUSB0,115200
{%- else -%}
console=tty0 console=ttyS0,{{ console_speed }}
{%- endif %}
diff --git a/data/templates/grub/grub_options.j2 b/data/templates/grub/grub_options.j2
index c8a1472e1..a00bf4e37 100644
--- a/data/templates/grub/grub_options.j2
+++ b/data/templates/grub/grub_options.j2
@@ -33,12 +33,6 @@ submenu "Boot options" {
setup_serial
configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg
}
- menuentry "ttyUSB (USB serial)" {
- set console_type="ttyUSB"
- export console_type
- setup_serial
- configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg
- }
}
menuentry "Enter console number" {
read console_num
diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py
index 1b487c1d2..94e40d268 100644
--- a/python/vyos/system/compat.py
+++ b/python/vyos/system/compat.py
@@ -220,14 +220,8 @@ def get_default(data: dict, root_dir: str = '') -> Union[int, None]:
sublist = list(filter(lambda x: (x.get('version') == image_name and
x.get('console_type') == console_type and
- x.get('console_num') == console_num and
x.get('bootmode') == 'normal'),
menu_entries))
- # legacy images added with legacy tools omitted 'ttyUSB'; if entry not
- # available, default to initial entry of version
- if not sublist:
- sublist = list(filter(lambda x: x.get('version') == image_name,
- menu_entries))
if sublist:
return menu_entries.index(sublist[0])
@@ -268,7 +262,9 @@ 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')
- new = deepcopy(list(filter(lambda x: x.get('version') == last,
+ # 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'),
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 ba0e3b6db..fdfaa1e17 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -65,7 +65,7 @@ MSG_INPUT_PASSWORD: str = 'Please enter a password for the "vyos" user:'
MSG_INPUT_PASSWORD_CONFIRM: str = 'Please confirm password for the "vyos" user:'
MSG_INPUT_ROOT_SIZE_ALL: str = 'Would you like to use all the free space on the drive?'
MSG_INPUT_ROOT_SIZE_SET: str = 'Please specify the size (in GB) of the root partition (min is 1.5 GB)?'
-MSG_INPUT_CONSOLE_TYPE: str = 'What console should be used by default? (K: KVM, S: Serial, U: USB-Serial)?'
+MSG_INPUT_CONSOLE_TYPE: str = 'What console should be used by default? (K: KVM, S: Serial)?'
MSG_INPUT_COPY_DATA: str = 'Would you like to copy data to the new image?'
MSG_INPUT_CHOOSE_COPY_DATA: str = 'From which image would you like to save config information?'
MSG_INPUT_COPY_ENC_DATA: str = 'Would you like to copy the encrypted config to the new image?'
@@ -710,8 +710,8 @@ def install_image() -> None:
# ask for default console
console_type: str = ask_input(MSG_INPUT_CONSOLE_TYPE,
default='K',
- valid_responses=['K', 'S', 'U'])
- console_dict: dict[str, str] = {'K': 'tty', 'S': 'ttyS', 'U': 'ttyUSB'}
+ valid_responses=['K', 'S'])
+ console_dict: dict[str, str] = {'K': 'tty', 'S': 'ttyS'}
config_boot_list = ['/opt/vyatta/etc/config/config.boot',
'/opt/vyatta/etc/config.boot.default']