Fwd: [PATCH v4] systemd: use serial-getty-generator on genericarm64
Bill Mills <[email protected]>
| Newsgroups | org.yoctoproject.lists.poky |
|---|---|
| Message-ID | <[email protected]> |
[resend after subscribe to poky, I guess I missed that one before]
Ross,
I don't want to bury the lead here: kv260 and some other boards are DOA in
5.2 for genericarm64 w/o a fix here. This is a regression against 5.1 and 5.0.
Yes we should have caught this earlier but we are where we are. We are
having internal discussions about how to fix the testing situation.
This is our bad but please let us know what you think the options are.
Background:
kv260 uses ttyPS1 for serial console. If systemd's getty-generator runs it
will do the right thing and start a getty on ttyPS1. It will also do the
right thing for any board or VM that correctly sets the DTB's
chosen/stdout-path as required by System Ready. It will do the right thing
if someone sets the console= on the command line and I believe it does the
right thing for ACPI (but I have not tested that WRT serial console).
In 5.0 and 5.1 systemd's getty-generator was run even when the image hard
coded ttyAMA0 and hvc0 in /etc/systemd/system/getty.target.wants/.
In 5.2 this was made "either or" and tty{S0,S1,S2) were added to the hard
coded list. This breaks any board that does not use ttyAMA0, hvc0, ttyS0,
ttyS1, or ttyS2 as the serial console. It also breaks any board that does
have a console on one of those ttys but also has Bluetooth or other device
on tty{S0,S1,S2}.
I strongly believe the correct thing to do for systemd is to use ONLY the
getty-generator. We should push for that in master. For walnascar I
think it best to switch to getty-generator also but adding ttyPS1 to the
list of hard coded SERIAL_CONSOLES for genericarm64 would at least fix the
regression.
BTW: ttyrun is not used in the [email protected] template so any missing tty
device for any on the hard coded list will delay startup "completion" for
90 seconds. It is almost 100% guaranteed that at least one of those will
be missing.
Thanks,
Bill
On 4/9/25 9:46 AM, Mikko Rapeli wrote:
> 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 <[email protected]>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> 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 --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"
> --
> 2.43.0
>
--
Bill Mills
Principal Technical Consultant, Linaro
+1-240-643-0836
TZ: US Eastern
Work Schedule: Tues/Wed/Thur