summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorJoe Slater <jslater@windriver.com>2016-08-15 16:04:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 16:52:06 +0100
commitbcc8b87c7242ff7daa87afea697bcce282998dc7 (patch)
treeba09a1363156ff6f06359c9385bd1c00605d17be /meta/recipes-core
parent6c24a6446a2e5310088bd13c0deaa2d2ac3484c9 (diff)
downloadpoky-bcc8b87c7242ff7daa87afea697bcce282998dc7.tar.gz
systemd-compat-units: pkg_postinst() does not work
The test for various files is wrong and will always be true, even if init.d does not exist. Exit if init.d does not exist, and correctly test for file existence otherwise. (From OE-Core rev: 8183309080aee45746daaff46b0506b09b5bd269) Signed-off-by: Joe Slater <jslater@windriver.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')
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units.bb17
1 files changed, 10 insertions, 7 deletions
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
index 0b8ff09b2b..90811da1bc 100644
--- a/meta/recipes-core/systemd/systemd-compat-units.bb
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -23,21 +23,24 @@ SYSTEMD_DISABLED_SYSV_SERVICES = " \
23" 23"
24 24
25pkg_postinst_${PN} () { 25pkg_postinst_${PN} () {
26 cd $D${sysconfdir}/init.d
27 26
28 echo "Disabling the following sysv scripts: " 27 cd $D${sysconfdir}/init.d || exit 0
29 28
30 OPTS="" 29 echo "Disabling the following sysv scripts: "
31 30
32 if [ -n "$D" ]; then 31 if [ -n "$D" ]; then
33 OPTS="--root=$D" 32 OPTS="--root=$D"
33 else
34 OPTS=""
34 fi 35 fi
35 36
36 for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do 37 for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
37 if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service \) ] ; then 38 if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service ] ; then
38 echo -n "$i: " ; systemctl ${OPTS} mask $i.service 39 echo -n "$i: "
40 systemctl $OPTS mask $i.service
39 fi 41 fi
40 done ; echo 42 done
43 echo
41} 44}
42 45
43RDPEPENDS_${PN} = "systemd" 46RDEPENDS_${PN} = "systemd"