From cbdd40320a10f6020f9d4a265fbffcf8e60c307d Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 26 Apr 2026 19:45:12 +0200 Subject: hooks: T8541: inject flavor serial console settings once into config.boot.default We do have different default console configurations per flavor used. We will set the serial console to the default configuration for the flavor once during ISO image assembly. --- data/live-build-config/hooks/live/95-serial.chroot | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 data/live-build-config/hooks/live/95-serial.chroot diff --git a/data/live-build-config/hooks/live/95-serial.chroot b/data/live-build-config/hooks/live/95-serial.chroot new file mode 100644 index 00000000..1bcaa963 --- /dev/null +++ b/data/live-build-config/hooks/live/95-serial.chroot @@ -0,0 +1,24 @@ +#!/bin/sh + +# We do have different default console configurations per flavor used. We will +# set the serial console to the default configuration for the flavor. +WRITE_CONFIG="/usr/libexec/vyos/write-config-file-value.py" +if ! test -x $WRITE_CONFIG; then + echo "E: missing script to implant serial config settings" + exit 1 +fi + +default_config_file=$(python3 -c 'from vyos.defaults import config_default; print(config_default)') +device=$(jq -r '"\(.console_type)\(.console_num)"' /usr/share/vyos/flavor.json) +speed=$(jq -r '.console_speed' /usr/share/vyos/flavor.json) + +if [ -n "$device" ] && [ -n "$speed" ] && [ -f $default_config_file ]; then + $WRITE_CONFIG --path "system console device $device speed" \ + --value "$speed" \ + --config-file $default_config_file + $WRITE_CONFIG --path "system console device $device kernel" \ + --config-file $default_config_file +else + echo "E: Could not implant serial console settings in: $default_config_file" + exit 1 +fi -- cgit v1.2.3