Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts" |
| 2 | |
| 3 | LICENSE = "MIT" |
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" |
| 5 | |
| 6 | PR = "r29" |
| 7 | |
| 8 | DEPENDS = "systemd-systemctl-native" |
| 9 | |
| 10 | S = "${WORKDIR}" |
| 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 12 | inherit distro_features_check |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | |
| 14 | ALLOW_EMPTY_${PN} = "1" |
| 15 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 16 | REQUIRED_DISTRO_FEATURES = "systemd" |
| 17 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | SYSTEMD_DISABLED_SYSV_SERVICES = " \ |
| 19 | busybox-udhcpc \ |
| 20 | hwclock \ |
| 21 | networking \ |
| 22 | nfsserver \ |
| 23 | nfscommon \ |
| 24 | syslog.busybox \ |
| 25 | " |
| 26 | |
| 27 | pkg_postinst_${PN} () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 28 | |
| 29 | cd $D${sysconfdir}/init.d || exit 0 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | |
| 31 | echo "Disabling the following sysv scripts: " |
| 32 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | if [ -n "$D" ]; then |
| 34 | OPTS="--root=$D" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 35 | else |
| 36 | OPTS="" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | fi |
| 38 | |
| 39 | for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 40 | if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service ] ; then |
| 41 | echo -n "$i: " |
| 42 | systemctl $OPTS mask $i.service |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 44 | done |
| 45 | echo |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | } |
| 47 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 48 | RDEPENDS_${PN} = "systemd" |