diff options
author | Andreas Müller <schnitzeltony@googlemail.com> | 2012-07-11 13:24:32 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-07-16 09:39:05 +0200 |
commit | a5b2aea321b2851ed82828e6204c075a2329059c (patch) | |
tree | 06c57ad79e5cdcb0b8b62bb6e910c29c379fac8c /meta-systemd/recipes-core/systemd/systemd-serialgetty.bb | |
parent | 5ed19733f5193b752da650841a1383adb532fffd (diff) | |
download | meta-openembedded-contrib-a5b2aea321b2851ed82828e6204c075a2329059c.tar.gz |
move systemd recipes to meta-systemd
Diffstat (limited to 'meta-systemd/recipes-core/systemd/systemd-serialgetty.bb')
-rw-r--r-- | meta-systemd/recipes-core/systemd/systemd-serialgetty.bb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/meta-systemd/recipes-core/systemd/systemd-serialgetty.bb b/meta-systemd/recipes-core/systemd/systemd-serialgetty.bb new file mode 100644 index 0000000000..c3106722f6 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd-serialgetty.bb @@ -0,0 +1,46 @@ +DESCRIPTION = "Systemd serial config" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=751419260aa954499f7abaabaa882bbe" + +PR = "r3" + +SERIAL_CONSOLE ?= "115200 ttyS0" + +SRC_URI = "file://LICENSE \ + 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}" |