From b8744d5376a9df4ec30120fdc8f39579d34d0545 Mon Sep 17 00:00:00 2001 From: Radu Moisan Date: Sat, 19 Jan 2013 22:47:07 +0000 Subject: systemd: add systemd recipes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add systemd recipes and associated support recipes. Mostly based on meta-oe/meta-systemd, so almost all credit should go to: Andreas Müller Denis 'GNUtoo' Carikli Holger Hans Peter Freyther Khem Raj Koen Kooi Martin Jansa (From OE-Core rev: 6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3) Signed-off-by: Radu Moisan Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-core/systemd/systemd-compat-units.bb | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd-compat-units.bb (limited to 'meta/recipes-core/systemd/systemd-compat-units.bb') 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" + + -- cgit v1.2.3-54-g00ecf