summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-05-13 13:40:07 +0200
committerGitHub <noreply@github.com>2026-05-13 14:40:07 +0300
commitbe3c157bd695ccb79a4d9cc25eae3328b9ab0a2f (patch)
treee3f164760c890f70d57d272a52cd3fbacae48c85
parent1dd997d724449e941c6bf42be98529372d9f1530 (diff)
downloadvyos-1x-be3c157bd695ccb79a4d9cc25eae3328b9ab0a2f.tar.gz
vyos-1x-be3c157bd695ccb79a4d9cc25eae3328b9ab0a2f.zip
serial: T8853: limit "kernel" CLI option to ttyS and ttyAMA interfaces only (#5193)
Recently (commit 35db941bcf "serial: T8375: add CLI option to explicitly set kernel console") we added the CLI knob to enable the Kernel and GRUB serial console on a given device. Currently this is supported for serial console interfaces starting with ttyS and ttyAMA only. Main limitation is that these interfaces are wired to the CPU and bootloader infos can be displayed.
-rwxr-xr-xsrc/conf_mode/system_console.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/conf_mode/system_console.py b/src/conf_mode/system_console.py
index 4985b80c0..51c95fcac 100755
--- a/src/conf_mode/system_console.py
+++ b/src/conf_mode/system_console.py
@@ -68,10 +68,12 @@ def verify(console):
# If the device name still starts with usbXXX no matching tty was found
# and it can not be used as a serial interface
if not os.path.isdir(by_bus_dir) or not os.path.exists(by_bus_device):
- raise ConfigError(f'Device {device} does not support being used as tty')
+ raise ConfigError(f'Device "{device}" does not support being used as tty')
if not is_tty(device, warning=True):
Warning(f'Device "{device}" used for console is not a TTY!')
if 'kernel' in device_config:
+ if not (device.startswith('ttyS') or device.startswith('ttyAMA')):
+ raise ConfigError(f'Device "{device}" unsupported for Kernel boot console')
kernel_consoles.append(device)
if len(kernel_consoles) > 1: