diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd-compat-units.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd-compat-units.bb | 56 |
1 files changed, 56 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..c47c14bf95 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-compat-units.bb | |||
@@ -0,0 +1,56 @@ | |||
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 | DEPENDS = "systemd-systemctl-native" | ||
9 | |||
10 | inherit allarch | ||
11 | |||
12 | SRC_URI = "file://*.service" | ||
13 | |||
14 | do_install() { | ||
15 | install -d ${D}${systemd_unitdir}/system/basic.target.wants | ||
16 | install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
17 | install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system | ||
18 | ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/ | ||
19 | ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
20 | |||
21 | install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system | ||
22 | ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/ | ||
23 | ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/ | ||
24 | } | ||
25 | |||
26 | SYSTEMD_DISABLED_SYSV_SERVICES = " \ | ||
27 | busybox-udhcpc \ | ||
28 | dnsmasq \ | ||
29 | hwclock \ | ||
30 | networking \ | ||
31 | syslog.busybox \ | ||
32 | dbus-1 \ | ||
33 | " | ||
34 | |||
35 | pkg_postinst_${PN} () { | ||
36 | cd $D${sysconfdir}/init.d | ||
37 | |||
38 | echo "Disabling the following sysv scripts: " | ||
39 | |||
40 | OPTS="" | ||
41 | |||
42 | if [ -n "$D" ]; then | ||
43 | OPTS="--root=$D" | ||
44 | fi | ||
45 | |||
46 | for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do | ||
47 | if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then | ||
48 | echo -n "$i: " ; systemctl ${OPTS} mask $i.service | ||
49 | fi | ||
50 | done ; echo | ||
51 | } | ||
52 | |||
53 | FILES_${PN} = "${systemd_unitdir}/system ${bindir}" | ||
54 | RDPEPENDS_${PN} = "systemd" | ||
55 | |||
56 | |||