diff mbox series

[v4] systemd: use serial-getty-generator on genericarm64

Message ID 20250409134615.240037-1-mikko.rapeli@linaro.org (mailing list archive)
State New
Headers show
Series [v4] systemd: use serial-getty-generator on genericarm64 | expand

Commit Message

Mikko Rapeli April 9, 2025, 1:46 p.m. UTC
systemd-serialgetty recipe sets serial consoles based
on SERIAL_CONSOLES build time variable. These fail to
be detected on multiple devices including qemu and the
resulting failures delay boot to systemd "running" state
by one minute on an example aarch64 build machine and qemu.
Serial console login works with both since udev will
trigger agetty on correct devices. Using systemd side
serial-getty-generator disables systemd-serialgetty.

qemu-system-aarch64 core-image-base boot time with
systemd-serialgetty before this patch:

$ systemd-analyze
Startup finished in 8.314s (firmware) + 9.805s (loader) + 14.338s (kernel) + 1min 34.392s (userspace) = 2min 6.851s
multi-user.target reached after 1min 34.387s in userspace.

with this patch:

Startup finished in 8.312s (firmware) + 9.804s (loader) + 14.295s (kernel) + 29.808s (userspace) = 1min 2.220s
multi-user.target reached after 29.802s in userspace.

After recent changes to serial-getty-generator, systemd init
and "poky-altcfg" builds for genericarm64 machine now
don't start agetty to serial consoles which are not
defined in SERIAL_CONSOLES at build time. This includes
AMD KV260 where boot succeeds with long delay and without
agetty serial login:

[ TIME ] Timed out waiting for device /dev/hvc0.
[5:185mDEPEND] Dependency failed for Serial Getty on hvc0.
[ TIME ] Timed out waiting for device /dev/ttyAMA0.
[5:185mDEPEND] Dependency failed for Serial Getty on ttyAMA0.
[ TIME ] Timed out waiting for device /dev/ttyS2.
[5:185mDEPEND] Dependency failed for Serial Getty on ttyS2.
[ TIME ] Timed out waiting for device /dev/ttyS1.
[5:185mDEPEND] Dependency failed for Serial Getty on ttyS1.
[ TIME ] Timed out waiting for device /dev/ttyS0.
[5:185mDEPEND] Dependency failed for Serial Getty on ttyS0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Reached target Multi-User System.

Fix is to either add all supported devices to SERIAL_CONSOLES
which has been rejected
https://lists.yoctoproject.org/g/poky/topic/109273447#msg13461
or using systemd to start agetty on all detected
serial console devices, this patch.

Without this patch AMD KV260 serial console login is broken on
"poky" and "poky-altcfg" distro genericarm64 builds from poky,
all images. With this patch "poky-altcfg" images have working
serial console login. This change is also needed in walnascar
branch.

Cc: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend

v4: improved commit message, no changes to v1

v3: https://lists.yoctoproject.org/g/poky/message/13575
    no changes to v1

v2: https://lists.yoctoproject.org/g/poky/message/13566
    no changes to v1

v1: https://lists.yoctoproject.org/g/poky/message/13522
diff mbox series

Patch

diff --git a/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 0000000000..f23852a351
--- /dev/null
+++ b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1,3 @@ 
+# auto detection instead of build time configured via SERIAL_CONSOLES
+# to support multiple devices
+PACKAGECONFIG:append:genericarm64 = " serial-getty-generator"