systemd: enable getty generator by default

Until recently, even when the getty generator was disabled in the
systemd recipe it was actually still active.  This was because the old
behaviour was to delete the serial-getty template unit if the generator
was disabled, but the systemd-serialgetty package shipped then shipped
the same files so the generator continued to run.  This was a bug in the
original commit[1] so this behaviour has been present since 2016.

My recent fixes[2] changed this: if the getty generator was disabled
then the generator itself is deleted. This makes the actual behaviour
match the intention, but the consequence was to demonstrate that some
modern platforms were relying on this unexpected behaviour: specifically
the genericarm64 BSP which intends to support a number of virtual and
physical boards with a number of serial console ports that are not
really suitable to be hardcoded into SERIAL_CONSOLES:

- ttyS0
- ttyAMA0 (AMBA PL011 uart)
- ttyS2 (BeagleBone Play, S0 and S1 are internal)
- hvc0 (KVM)
- ttyPS1 (AMD KV260)
- And most likely more

Restore the existing behaviour by explicitly enabling the serial getty
generator: this means that systemd will automatically bring up a getty
on the first serial console it finds.

In the future we should extend some level of dynamic console-finding to
sysvinit-based systems by searching for a console device in inittab, but
for now this reverts the unintentional regression.

[1] oe-core 2a8d0df47c9 ("systemd: make systemd-serialgetty optional")
[2] oe-core 2beb3170af6 ("systemd: if getty generator is disabled remove
    the generator, not the units")

(From OE-Core rev: af15f9d1609708443ed036fdb611cea92f566620)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2025-04-22 20:00:51 +01:00 committed by Richard Purdie
parent b7fcba6e51
commit 11a005cae7

View File

@ -92,6 +92,7 @@ PACKAGECONFIG ??= " \
quotacheck \
randomseed \
resolved \
serial-getty-generator \
set-time-epoch \
sysusers \
timedated \