Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] systemd-serialgetty: Fix do_install for mixed baud rates
@ 2026-11-20 16:33 Niko Mauno
  2026-11-26 15:09 ` Paul Barker
  0 siblings, 1 reply; 3+ messages in thread
From: Niko Mauno @ 2026-11-20 16:33 UTC (permalink / raw)
  To: openembedded-core; +Cc: Niko Mauno

Since commit b6a7617145c3 ("systemd-serialgetty: use existing unit
files in systemd") removed the recipe's own serial-getty@.service, any
SERIAL_CONSOLES entry whose baud rate differs from the first one fails
do_install, as the unit template it copies no longer exists:

  install: cannot stat '.../serial-getty@.service': No such file or directory

Enable systemd's serial-getty@.service for every console instead, as is
already done for the first one. That unit runs agetty with --keep-baud,
so a console's configured rate takes effect only where the kernel has
set it up, i.e. on a kernel console. Since b6a7617145c3 this has been
true of the first entry as well; say so in the recipe.

Tested on master and wrynose with mixed-rate SERIAL_CONSOLES: both
consoles get a getty, and on a qemux86-64 boot with "115200;ttyS0
38400;ttyS1", ttyS1, not a kernel console, runs at the 9600 default.

Fixes: b6a7617145c3 ("systemd-serialgetty: use existing unit files in systemd")
AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 .../recipes-core/systemd/systemd-serialgetty.bb | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
index c3fe9d5b6d..807dd8bb9f 100644
--- a/meta/recipes-core/systemd/systemd-serialgetty.bb
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;m
 # will probe at boot and generate getty instances for any active consoles as
 # required.  This recipe (enabled via disabling serial-getty-generator in systemd)
 # should only be used if the generator is not appropriate.
+# Its gettys ignore SERIAL_CONSOLES baud rates and keep the rate the kernel set.
 
 # As this package is tied to systemd, only build it when we're also building systemd.
 inherit features_check
@@ -16,25 +17,13 @@ REQUIRED_DISTRO_FEATURES += "usrmerge"
 
 do_install() {
 	if [ ! -z "${SERIAL_CONSOLES}" ] ; then
-		default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
 		install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
 
 		tmp="${SERIAL_CONSOLES}"
 		for entry in $tmp ; do
-			baudrate=`echo $entry | sed 's/\;.*//'`
 			ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
-			if [ "$baudrate" = "$default_baudrate" ] ; then
-				# enable the service
-				ln -sf ${systemd_system_unitdir}/serial-getty@.service \
-					${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
-			else
-				# install custom service file for the non-default baudrate
-				install -m 0644 ${S}/serial-getty@.service ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service
-				sed -i -e "s/\@BAUDRATE\@/$baudrate/g" ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service
-				# enable the service
-				ln -sf ${systemd_system_unitdir}/serial-getty$baudrate@.service \
-					${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
-			fi
+			ln -sf ${systemd_system_unitdir}/serial-getty@.service \
+				${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
 		done
 	fi
 }
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-27 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 16:33 [PATCH] systemd-serialgetty: Fix do_install for mixed baud rates Niko Mauno
2026-11-26 15:09 ` Paul Barker
2026-11-27 11:19   ` [PATCH v2] systemd-serialgetty: Fix console " Niko Mauno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox