diff options
| -rw-r--r-- | data/architectures/amd64.toml | 2 | ||||
| -rw-r--r-- | data/architectures/arm64.toml | 1 | ||||
| -rwxr-xr-x | data/live-build-config/hooks/live/01-live-serial.binary | 11 | ||||
| -rwxr-xr-x | data/live-build-config/hooks/live/05-event_tty.chroot | 34 | ||||
| -rw-r--r-- | data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry | 4 | ||||
| -rwxr-xr-x | scripts/image-build/build-vyos-image | 4 |
6 files changed, 18 insertions, 38 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 diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image index 566dac91..f79ce2ee 100755 --- a/scripts/image-build/build-vyos-image +++ b/scripts/image-build/build-vyos-image @@ -631,8 +631,8 @@ DOCUMENTATION_URL="{build_config['documentation_url']}" --archive-areas "{{debian_archive_areas}}" \ --backports true \ --binary-image iso-hybrid \ - --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console=ttyS0,115200 console=tty0 net.ifnames=0 biosdevname=0" \ - --bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console=ttyS0,115200 console=tty0 net.ifnames=0 biosdevname=0" \ + --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{serial_interface}}" console=tty0 net.ifnames=0 biosdevname=0" \ + --bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console="{{serial_interface}}" console=tty0 net.ifnames=0 biosdevname=0" \ --bootloaders "{{bootloaders}}" \ --checksums "sha256" \ --chroot-squashfs-compression-type "{{squashfs_compression_type}}" \ |
