diff options
author | Radu Moisan <radu.moisan@intel.com> | 2013-01-19 22:47:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-20 12:45:00 +0000 |
commit | 6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3 (patch) | |
tree | e1c5228c385c0e8618394c063598aa1cb710d66e /meta/recipes-core/systemd/systemd-compat-units.bb | |
parent | 06e262c9b4c406b886db6ca8eee55ab441599151 (diff) | |
download | openembedded-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-compat-units.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd-compat-units.bb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb new file mode 100644 index 0000000000..a7bfee3c4b --- /dev/null +++ b/meta/recipes-core/systemd/systemd-compat-units.bb @@ -0,0 +1,58 @@ +DESCRIPTION = "Units to make systemd work better with existing sysvinit scripts" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" + +PR = "r18" + +inherit allarch + +SRC_URI = "file://*.service" + +do_install() { + install -d ${D}${systemd_unitdir}/system/basic.target.wants + install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ + install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system + ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/ + ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ + + install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system + ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ + ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/ + + # hack to make old style sysvinit postinsts succeed + install -d ${D}${bindir} + echo "echo 1" > ${D}${bindir}/runlevel + chmod 0755 ${D}${bindir}/runlevel +} + +SYSTEMD_DISABLED_SYSV_SERVICES = " \ + busybox-udhcpc \ + dnsmasq \ + hwclock \ + networking \ + syslog.busybox \ +" + +pkg_postinst_${PN} () { + cd $D${sysconfdir}/init.d + + echo "Disabling the following sysv scripts: " + + OPTS="" + + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + + for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do + if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then + echo -n "$i: " ; systemctl ${OPTS} mask $i.service + fi + done ; echo +} + +FILES_${PN} = "${systemd_unitdir}/system ${bindir}" +RDPEPENDS_${PN} = "systemd" + + |