Skip to contentSkip to conversation

systemd-serial-getty obsolete?

RFC PATCH New Patrick Ohly 1 participant 2 messages Mar 9, 2016 – Mar 10, 2016

lore
Share & tools
lore
#0 lore raw

Hello!

systemd-serialgetty.bb was introduced in OE-core together with systemd 1.96 and probably goes back even further (copied from meta-systemd). It explicitly instantiates [email protected] for serial ports specified by SERIAL_CONSOLES.

I'm wondering whether that is still needed. systemd also has a generator
[1] that can activate serial-getty based on kernel boot parameters [2].

Is systemd-serialgetty.bb perhaps kept around because the "console" parameters added to APPEND are (perhaps intentionally) not the same as SERIAL_CONSOLES?

[1] https://www.freedesktop.org/software/systemd/man/systemd-getty-generator.html
[2] http://0pointer.de/blog/projects/serial-console.html

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#1 lore raw

RFC PATCH 1/1 systemd: make systemd-serialgetty optional

Some distros may prefer to use the upstream systemd support for starting getty on serial ports. This is now possible by adding "serial-getty-generator" to PACKAGECONFIG.

The default is unchanged, i.e. systemd's own [email protected] file does not get packaged and instead systemd-serialgetty is pulled into images via RRECOMMENDS.

---
 meta/recipes-core/systemd/systemd_229.bb | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd_229.bb +12 -3
index cd48360..3c4d877 100644
@@ -148,6 +148,11 @@ PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4"
 PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
 PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
 
+# Use the upstream systemd [email protected] and rely on
+# systemd-getty-generator instead of using the OE-core specific
+# systemd-serialgetty.bb - not enabled by default.
+PACKAGECONFIG[serial-getty-generator] = ""
+
 CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
 CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
 CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
@@ -201,8 +206,10 @@ do_configure_prepend() {
 do_install() {
 	autotools_do_install
 	install -d ${D}/${base_sbindir}
-	# Provided by a separate recipe
-	rm ${D}${systemd_unitdir}/system/serial-getty* -f
+	if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
+		# Provided by a separate recipe
+		rm ${D}${systemd_unitdir}/system/serial-getty* -f
+	fi
 
 	# Provide support for initramfs
 	[ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
@@ -439,7 +446,9 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
 RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
 RDEPENDS_${PN} += "volatile-binds update-rc.d"
 
-RRECOMMENDS_${PN} += "systemd-serialgetty systemd-vconsole-setup \
+RRECOMMENDS_${PN} += " \
+                      ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)} \
+                      systemd-vconsole-setup \
                       systemd-extra-utils \
                       systemd-compat-units udev-hwdb \
                       util-linux-agetty  util-linux-fsck e2fsprogs-e2fsck \
Signature · 1 line
2.1.4