diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-03-02 16:28:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-02 16:28:50 +0200 |
| commit | ff2a5df902ca31d51eda6744c94cb257d162fcfc (patch) | |
| tree | bc022bf3465f7468f88ee753ba179ec7f6bc50dd /data | |
| parent | 1dc2c7748ad5a92faa8fd3a13264c874b2336483 (diff) | |
| parent | f0dfd279c4f1f4065d893ddf22ca57d4b31cb542 (diff) | |
| download | vyos-build-ff2a5df902ca31d51eda6744c94cb257d162fcfc.tar.gz vyos-build-ff2a5df902ca31d51eda6744c94cb257d162fcfc.zip | |
Merge pull request #1128 from c-po/per-arch-kernel-serial-interface
T8120: add support for per CPU architecture serial interface name
Diffstat (limited to 'data')
5 files changed, 16 insertions, 36 deletions
diff --git a/data/architectures/amd64.toml b/data/architectures/amd64.toml index aeea8ffe..784d77ad 100644 --- a/data/architectures/amd64.toml +++ b/data/architectures/amd64.toml @@ -11,3 +11,5 @@ packages = [ "intel-microcode", "amd64-microcode" ] + +serial_interface = "ttyS0,115200"
\ No newline at end of file diff --git a/data/architectures/arm64.toml b/data/architectures/arm64.toml index 07de5225..415f54b8 100644 --- a/data/architectures/arm64.toml +++ b/data/architectures/arm64.toml @@ -4,3 +4,4 @@ packages = [ ] bootloaders = "grub-efi" squashfs_compression_type = "xz -b 256k -always-use-fragments -no-recovery" +serial_interface = "ttyAMA0,115200" diff --git a/data/live-build-config/hooks/live/01-live-serial.binary b/data/live-build-config/hooks/live/01-live-serial.binary index 0e449fc9..b1f6b43b 100755 --- a/data/live-build-config/hooks/live/01-live-serial.binary +++ b/data/live-build-config/hooks/live/01-live-serial.binary @@ -3,8 +3,15 @@ GRUB_PATH=boot/grub/grub.cfg ISOLINUX_PATH=isolinux/live.cfg -KVM_CONSOLE="console=ttyS0,115200 console=tty0" -SERIAL_CONSOLE="console=tty0 console=ttyS0,115200" +# Detect serial console type from existing GRUB config +if grep -q "console=ttyAMA" "${GRUB_PATH}"; then + SERIAL_TTY="ttyAMA0" +else + SERIAL_TTY="ttyS0" +fi + +KVM_CONSOLE="console=${SERIAL_TTY},115200 console=tty0" +SERIAL_CONSOLE="console=tty0 console=${SERIAL_TTY},115200" # Grub.cfg Update GRUB_MENUENTRY=$(sed -e '/menuentry.*hotkey.*/,/^}/!d' -e 's/--hotkey=l//g' $GRUB_PATH) diff --git a/data/live-build-config/hooks/live/05-event_tty.chroot b/data/live-build-config/hooks/live/05-event_tty.chroot deleted file mode 100755 index 81ef6257..00000000 --- a/data/live-build-config/hooks/live/05-event_tty.chroot +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -if [ -r etc/event.d/tty1 ] ; then - echo I: Delay getty until rcX completes - sed -i 's/start on runlevel /start on stopped rc/' \ - etc/event.d/tty[1-6] - if [ ! -r etc/event.d/ttyS0 ] && [ -c dev/ttyS0 ] ; then - echo I: Enable serial console login - cat <<-EOF > etc/event.d/ttyS0 - # ttyS0 - getty - # - # This service maintains a getty on ttyS0 from the point the system is - # started until it is shut down again. - - start on stopped rc2 - start on stopped rc3 - start on stopped rc4 - start on stopped rc5 - - stop on runlevel 0 - stop on runlevel 1 - stop on runlevel 6 - - respawn - exec /sbin/getty 115200 ttyS0 vt100 - - EOF - fi -fi - -if [ -r etc/inittab ] && [ -c dev/ttyS0 ] && grep -q '^#T0:.*getty.*ttyS0' etc/inittab ; then - echo I: Enable serial console login - sed -i '/^#T0:/s|^#.*$|T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100|' etc/inittab -fi diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry index 49f4afc4..213adf43 100644 --- a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry @@ -1,3 +1,7 @@ +# This file is only needed to support upgrades from the legacy image management +# tools. Example would be an upgrade from VyOS 1.3.8 -> 1.5 (which is officially +# unsupported, but we always try our best). This is also the reason why we can +# leave the ttyS0 console in this file - there was no ARM64 image for VyOS 1.3! menuentry "VyOS (KVM console)" { linux /boot//vmlinuz boot=live quiet rootdelay=5 noautologin net.ifnames=0 biosdevname=0 udev.exec_delay=3 vyos-union=/boot/ console=ttyS0,115200 console=tty0 initrd /boot//initrd.img |
