]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd-serialgetty: use existing unit files in systemd
authorRoss Burton <ross.burton@arm.com>
Mon, 3 Mar 2025 16:15:27 +0000 (16:15 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Mar 2025 11:16:41 +0000 (11:16 +0000)
Now that systemd isn't deleting the serial-getty@.service unit template
files, we can simply symlink to the files provided by systemd instead of
shipping a copy of them in this recipe.

This ensures that the getty units triggered by the systemd are identical,
be them via SERIAL_CONSOLES or the generator.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd-serialgetty.bb
meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service [deleted file]

index daac7f419867fd8d1317f774fc00e57f21b2864d..c3fe9d5b6d407a4a34ae52f67959067f2d749ac4 100644 (file)
@@ -9,13 +9,6 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;m
 # required.  This recipe (enabled via disabling serial-getty-generator in systemd)
 # should only be used if the generator is not appropriate.
 
-SERIAL_TERM ?= "linux"
-
-SRC_URI = "file://serial-getty@.service"
-
-S = "${WORKDIR}/sources"
-UNPACKDIR = "${S}"
-
 # As this package is tied to systemd, only build it when we're also building systemd.
 inherit features_check
 REQUIRED_DISTRO_FEATURES += "systemd"
@@ -24,11 +17,7 @@ REQUIRED_DISTRO_FEATURES += "usrmerge"
 do_install() {
        if [ ! -z "${SERIAL_CONSOLES}" ] ; then
                default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
-               install -d ${D}${systemd_system_unitdir}/
                install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
-               install -m 0644 ${S}/serial-getty@.service ${D}${systemd_system_unitdir}/
-               sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ${D}${systemd_system_unitdir}/serial-getty@.service
-               sed -i -e "s/\@TERM\@/${SERIAL_TERM}/g" ${D}${systemd_system_unitdir}/serial-getty@.service
 
                tmp="${SERIAL_CONSOLES}"
                for entry in $tmp ; do
@@ -51,7 +40,7 @@ do_install() {
 }
 
 # This is a machine specific file
-FILES:${PN} = "${systemd_system_unitdir}/*.service ${sysconfdir}"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
+FILES:${PN} = "${sysconfdir}"
 
 ALLOW_EMPTY:${PN} = "1"
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
deleted file mode 100644 (file)
index b16fe11..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#  SPDX-License-Identifier: LGPL-2.1+
-#
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Serial Getty on %I
-Documentation=man:agetty(8) man:systemd-getty-generator(8)
-Documentation=http://0pointer.de/blog/projects/serial-console.html
-PartOf=dev-%i.device
-ConditionPathExists=/dev/%i
-After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
-After=rc-local.service
-
-# If additional gettys are spawned during boot then we should make
-# sure that this is synchronized before getty.target, even though
-# getty.target didn't actually pull it in.
-Before=getty.target
-IgnoreOnIsolate=yes
-
-# IgnoreOnIsolate causes issues with sulogin, if someone isolates
-# rescue.target or starts rescue.service from multi-user.target or
-# graphical.target.
-Conflicts=rescue.service
-Before=rescue.service
-
-[Service]
-Environment="TERM=@TERM@"
-ExecStart=-/sbin/agetty -8 -L %I @BAUDRATE@ $TERM
-Type=idle
-Restart=always
-UtmpIdentifier=%I
-TTYPath=/dev/%I
-TTYReset=yes
-TTYVHangup=yes
-KillMode=process
-IgnoreSIGPIPE=no
-SendSIGHUP=yes
-
-[Install]
-WantedBy=getty.target