From 21321ac018d3771c7536a4cd1295e7eabfc5de54 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 6 Oct 2023 12:42:14 +0200 Subject: [PATCH] arm: fix console parameter for ARM cloud-images On armhf and arm64 the QEMU virt machine provides the serial console as an emulated AMBA PrimeCell UART which the kernel refers to as /dev/ttyAMA0. Consider this when constructing GRUB_CMDLINE_LINUX_DEFAULT in file /etc/default/grub.d/50-cloudimg-settings.cfg (LP: #2036730). Reviewed-by: Gauthier Jolly Signed-off-by: Heinrich Schuchardt --- .../ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot index 12956529..772c4a0c 100755 --- a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot @@ -170,6 +170,16 @@ fi psuedo_grub_probe > "${gprobe}" chmod 755 "${gprobe}" +case $arch in + armhf|arm64) + # QEMU virt machine provides AMBA PrimeCell UART + serial_console='ttyAMA0' + ;; + *) + serial_console='ttyS0' + ;; +esac + # for Quantal and later, use /etc/default/grub.d functionality # rather than modifying the grub configuration itself. # This avoids the mess of having to do dpkg stuff @@ -186,7 +196,7 @@ GRUB_RECORDFAIL_TIMEOUT=0 GRUB_TIMEOUT=0 # Set the default commandline -GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0" +GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=${serial_console}" # Set the grub console type GRUB_TERMINAL=console