summaryrefslogtreecommitdiffstats
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:58:55 +0000
commitb8744d5376a9df4ec30120fdc8f39579d34d0545 (patch)
tree9503d5816da66544969292ddb5ff999e50c1b9a8 /meta/recipes-core/systemd/systemd-serialgetty.bb
parentb18886d9b7c913cd463a98d0ef1b3a8a240f5791 (diff)
downloadpoky-b8744d5376a9df4ec30120fdc8f39579d34d0545.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> (From OE-Core rev: 6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3) 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 @@
1DESCRIPTION = "Systemd serial config"
2LICENSE = "GPLv2+"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5PR = "r3"
6
7SERIAL_CONSOLE ?= "115200 ttyS0"
8
9SRC_URI = "file://serial-getty@.service"
10
11def get_serial_console_value(d, index):
12 c = d.getVar('SERIAL_CONSOLE', True)
13
14 if len(c):
15 return c.split()[index]
16
17 return ""
18
19def get_baudrate(d):
20 return get_serial_console_value(d, 0)
21
22def get_console(d):
23 return get_serial_console_value(d, 1)
24
25do_install() {
26 if [ ! ${@get_baudrate(d)} = "" ]; then
27 sed -i -e s/\@BAUDRATE\@/${@get_baudrate(d)}/g ${WORKDIR}/serial-getty@.service
28 install -d ${D}${systemd_unitdir}/system/
29 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
30 install ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
31
32 # enable the service
33 ln -sf ${systemd_unitdir}/system/serial-getty@.service \
34 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(d)}.service
35 fi
36}
37
38PACKAGES = "${PN} ${PN}-dbg ${PN}-dev ${PN}-doc"
39
40RRECOMMENDS_${PN} = ""
41RDEPENDS_${PN} = "systemd"
42
43# This is a machine specific file
44FILES_${PN} = "${systemd_unitdir}/system/serial-getty@.service ${sysconfdir}"
45PACKAGE_ARCH = "${MACHINE_ARCH}"