]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
default-distrovars: Have KERNEL_CONSOLE reference SERIAL_CONSOLES
authorJon Mason <jdmason@kudzu.us>
Tue, 1 Oct 2024 13:43:22 +0000 (09:43 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Oct 2024 12:26:28 +0000 (13:26 +0100)
Currently, KERNEL_CONSOLE has a default value of "ttyS0".  However, Arm
machines and those using virtio serial prefer to use "ttyAMA0" or "hvc0"
(or something else).  These are usually defined by the machine config
file as SERIAL_CONSOLES, which has one or more entries.  Take the first
one of those instead of ttyS0, but default back to ttyS0 if nothing is
set.

Also, use this variable in the efi wic file instead of "ttyS0".
Of note, this changes the default speed of the default kernel console
from undefined (9600) to 115200.  This allows for users of the
mkefidisk.wks to work as before but any users of this variable could see
changed behavior and would now need to define this as:
KERNEL_CONSOLE ?= "ttyS0,9600"

This includes revisions suggested by Quentin Schulz and Ross Burton.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/image_types_wic.bbclass
meta/conf/distro/include/default-distrovars.inc
scripts/lib/wic/canned-wks/mkefidisk.wks

index 86f40633ebcb67d1ab95c3695884f9355fd5da93..1fa016c16eb7f69fbb619e043c120afefbe4fc5c 100644 (file)
@@ -26,6 +26,7 @@ WICVARS ?= "\
        INITRD \
        INITRD_LIVE \
        ISODIR \
+       KERNEL_CONSOLE \
        KERNEL_IMAGETYPE \
        MACHINE \
        PSEUDO_IGNORE_PATHS \
index 7554081e8b1a4b6cfecaf2832ecfa8b3b471f8aa..85835c4c617982885dd787b4d282e2a01fcdd1a4 100644 (file)
@@ -1,7 +1,8 @@
 QA_LOGFILE = "${TMPDIR}/qa.log"
 
 OEINCLUDELOGS ?= "yes"
-KERNEL_CONSOLE ?= "ttyS0"
+# if SERIAL_CONSOLES is set, take the first device entry.  Otherwise use ttyS0 as the default
+KERNEL_CONSOLE ?= "${@','.join(d.getVar('SERIAL_CONSOLES').split(' ')[0].split(';')[::-1]) or 'ttyS0,115200'}"
 KEEPUIMAGE ??= "yes"
 
 DEFAULT_IMAGE_LINGUAS = "en-us en-gb"
index 9f534fe18471de4f47fbc1bf826ecdc4f19e6ce8..5fa6682a9e10d44381fc9014105f2c7d85ff40e2 100644 (file)
@@ -8,4 +8,4 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
 
 part swap --ondisk sda --size 44 --label swap1 --fstype=swap
 
-bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=${KERNEL_CONSOLE} console=tty0"