diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-04-28 16:59:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-28 16:59:28 +0200 |
| commit | 57591d2137d1ddfe3c19cf220ce7ed759dc5b040 (patch) | |
| tree | 6ee8c53727c36226891ced46bdfd853159818487 | |
| parent | d1bfa067311a6fdc992765b0bb8c8ff995e1104f (diff) | |
| parent | cbdd40320a10f6020f9d4a265fbffcf8e60c307d (diff) | |
| download | vyos-build-57591d2137d1ddfe3c19cf220ce7ed759dc5b040.tar.gz vyos-build-57591d2137d1ddfe3c19cf220ce7ed759dc5b040.zip | |
Merge pull request #1167 from c-po/serial
hooks: T8541: inject flavor serial console settings once into config.boot.default
| -rw-r--r-- | data/live-build-config/hooks/live/95-serial.chroot | 24 |
1 files changed, 24 insertions, 0 deletions
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 |
