Skip to content

Commit ff2a5df

Browse files
authored
Merge pull request #1128 from c-po/per-arch-kernel-serial-interface
T8120: add support for per CPU architecture serial interface name
2 parents 1dc2c77 + f0dfd27 commit ff2a5df

File tree

6 files changed

+18
-38
lines changed

6 files changed

+18
-38
lines changed

data/architectures/amd64.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ packages = [
1111
"intel-microcode",
1212
"amd64-microcode"
1313
]
14+
15+
serial_interface = "ttyS0,115200"

data/architectures/arm64.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ packages = [
44
]
55
bootloaders = "grub-efi"
66
squashfs_compression_type = "xz -b 256k -always-use-fragments -no-recovery"
7+
serial_interface = "ttyAMA0,115200"

data/live-build-config/hooks/live/01-live-serial.binary

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
GRUB_PATH=boot/grub/grub.cfg
44
ISOLINUX_PATH=isolinux/live.cfg
55

6-
KVM_CONSOLE="console=ttyS0,115200 console=tty0"
7-
SERIAL_CONSOLE="console=tty0 console=ttyS0,115200"
6+
# Detect serial console type from existing GRUB config
7+
if grep -q "console=ttyAMA" "${GRUB_PATH}"; then
8+
SERIAL_TTY="ttyAMA0"
9+
else
10+
SERIAL_TTY="ttyS0"
11+
fi
12+
13+
KVM_CONSOLE="console=${SERIAL_TTY},115200 console=tty0"
14+
SERIAL_CONSOLE="console=tty0 console=${SERIAL_TTY},115200"
815

916
# Grub.cfg Update
1017
GRUB_MENUENTRY=$(sed -e '/menuentry.*hotkey.*/,/^}/!d' -e 's/--hotkey=l//g' $GRUB_PATH)

data/live-build-config/hooks/live/05-event_tty.chroot

Lines changed: 0 additions & 34 deletions
This file was deleted.

data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This file is only needed to support upgrades from the legacy image management
2+
# tools. Example would be an upgrade from VyOS 1.3.8 -> 1.5 (which is officially
3+
# unsupported, but we always try our best). This is also the reason why we can
4+
# leave the ttyS0 console in this file - there was no ARM64 image for VyOS 1.3!
15
menuentry "VyOS (KVM console)" {
26
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
37
initrd /boot//initrd.img

scripts/image-build/build-vyos-image

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ DOCUMENTATION_URL="{build_config['documentation_url']}"
631631
--archive-areas "{{debian_archive_areas}}" \
632632
--backports true \
633633
--binary-image iso-hybrid \
634-
--bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console=ttyS0,115200 console=tty0 net.ifnames=0 biosdevname=0" \
635-
--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" \
634+
--bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{serial_interface}}" console=tty0 net.ifnames=0 biosdevname=0" \
635+
--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" \
636636
--bootloaders "{{bootloaders}}" \
637637
--checksums "sha256" \
638638
--chroot-squashfs-compression-type "{{squashfs_compression_type}}" \

0 commit comments

Comments
 (0)