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:58:55 +0000 |
commit | b8744d5376a9df4ec30120fdc8f39579d34d0545 (patch) | |
tree | 9503d5816da66544969292ddb5ff999e50c1b9a8 /meta/recipes-core/systemd/systemd-compat-units.bb | |
parent | b18886d9b7c913cd463a98d0ef1b3a8a240f5791 (diff) | |
download | poky-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-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 @@ | |||
1 | DESCRIPTION = "Units to make systemd work better with existing sysvinit scripts" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
5 | |||
6 | PR = "r18" | ||
7 | |||
8 | inherit allarch | ||
9 | |||
10 | SRC_URI = "file://*.service" | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}${systemd_unitdir}/system/basic.target.wants | ||
14 | install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
15 | install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system | ||
16 | ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/ | ||
17 | ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
18 | |||
19 | install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system | ||
20 | ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
21 | ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/ | ||
22 | |||
23 | # hack to make old style sysvinit postinsts succeed | ||
24 | install -d ${D}${bindir} | ||
25 | echo "echo 1" > ${D}${bindir}/runlevel | ||
26 | chmod 0755 ${D}${bindir}/runlevel | ||
27 | } | ||
28 | |||
29 | SYSTEMD_DISABLED_SYSV_SERVICES = " \ | ||
30 | busybox-udhcpc \ | ||
31 | dnsmasq \ | ||
32 | hwclock \ | ||
33 | networking \ | ||
34 | syslog.busybox \ | ||
35 | " | ||
36 | |||
37 | pkg_postinst_${PN} () { | ||
38 | cd $D${sysconfdir}/init.d | ||
39 | |||
40 | echo "Disabling the following sysv scripts: " | ||
41 | |||
42 | OPTS="" | ||
43 | |||
44 | if [ -n "$D" ]; then | ||
45 | OPTS="--root=$D" | ||
46 | fi | ||
47 | |||
48 | for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do | ||
49 | if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then | ||
50 | echo -n "$i: " ; systemctl ${OPTS} mask $i.service | ||
51 | fi | ||
52 | done ; echo | ||
53 | } | ||
54 | |||
55 | FILES_${PN} = "${systemd_unitdir}/system ${bindir}" | ||
56 | RDPEPENDS_${PN} = "systemd" | ||
57 | |||
58 | |||