From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- .../recipes-core/systemd/systemd-serialgetty.bb | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 poky/meta/recipes-core/systemd/systemd-serialgetty.bb (limited to 'poky/meta/recipes-core/systemd/systemd-serialgetty.bb') diff --git a/poky/meta/recipes-core/systemd/systemd-serialgetty.bb b/poky/meta/recipes-core/systemd/systemd-serialgetty.bb new file mode 100644 index 000000000..d67a3c91b --- /dev/null +++ b/poky/meta/recipes-core/systemd/systemd-serialgetty.bb @@ -0,0 +1,50 @@ +SUMMARY = "Serial terminal support for systemd" +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/systemd/" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +PR = "r5" + +SERIAL_CONSOLE ?= "115200 ttyS0" + +SRC_URI = "file://serial-getty@.service" + +S = "${WORKDIR}" + +# As this package is tied to systemd, only build it when we're also building systemd. +inherit distro_features_check +REQUIRED_DISTRO_FEATURES = "systemd" + +do_install() { + if [ ! -z "${SERIAL_CONSOLES}" ] ; then + default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'` + install -d ${D}${systemd_unitdir}/system/ + install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ + install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/ + sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service + + 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_unitdir}/system/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 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service + sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service + # enable the service + ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \ + ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service + fi + done + fi +} + +# This is a machine specific file +FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +ALLOW_EMPTY_${PN} = "1" -- cgit v1.2.3