aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd-serialgetty.bb
diff options
context:
space:
mode:
authorRadu Moisan <radu.moisan@intel.com>2013-01-19 22:47:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:45:00 +0000
commit6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3 (patch)
treee1c5228c385c0e8618394c063598aa1cb710d66e /meta/recipes-core/systemd/systemd-serialgetty.bb
parent06e262c9b4c406b886db6ca8eee55ab441599151 (diff)
downloadopenembedded-core-contrib-6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3.tar.gz
systemd: add systemd recipes
Add systemd recipes and associated support recipes. Mostly based on meta-oe/meta-systemd, so almost all credit should go to: Andreas Müller <schnitzeltony@googlemail.com> Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Holger Hans Peter Freyther <holger@moiji-mobile.com> Khem Raj <raj.khem@gmail.com> Koen Kooi <koen@dominion.thruhere.net> Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd-serialgetty.bb')
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty.bb45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 0000000000..7e7368b875
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,45 @@
+DESCRIPTION = "Systemd serial config"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r3"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+SRC_URI = "file://serial-getty@.service"
+
+def get_serial_console_value(d, index):
+ c = d.getVar('SERIAL_CONSOLE', True)
+
+ if len(c):
+ return c.split()[index]
+
+ return ""
+
+def get_baudrate(d):
+ return get_serial_console_value(d, 0)
+
+def get_console(d):
+ return get_serial_console_value(d, 1)
+
+do_install() {
+ if [ ! ${@get_baudrate(d)} = "" ]; then
+ sed -i -e s/\@BAUDRATE\@/${@get_baudrate(d)}/g ${WORKDIR}/serial-getty@.service
+ install -d ${D}${systemd_unitdir}/system/
+ install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
+ install ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
+
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(d)}.service
+ fi
+}
+
+PACKAGES = "${PN} ${PN}-dbg ${PN}-dev ${PN}-doc"
+
+RRECOMMENDS_${PN} = ""
+RDEPENDS_${PN} = "systemd"
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/serial-getty@.service ${sysconfdir}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"