aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Slater <jslater@windriver.com>2016-08-15 16:04:53 -0700
committerAndreas Oberritter <obi@opendreambox.org>2017-06-26 22:57:19 +0200
commit2579a0b45d841adf69ee2c1e03e5bfe861db46a9 (patch)
treefd4ac5caba81eef7e2a2c89eea3ad48964773e97
parentc79779a03207db7c57a19e6ae4e1b7653f7ef1cb (diff)
downloadopenembedded-core-contrib-2579a0b45d841adf69ee2c1e03e5bfe861db46a9.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. Signed-off-by: Joe Slater <jslater@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 8183309080aee45746daaff46b0506b09b5bd269) Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
-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 = " \
"
pkg_postinst_${PN} () {
- cd $D${sysconfdir}/init.d
- echo "Disabling the following sysv scripts: "
+ cd $D${sysconfdir}/init.d || exit 0
- OPTS=""
+ echo "Disabling the following sysv scripts: "
if [ -n "$D" ]; then
OPTS="--root=$D"
+ else
+ OPTS=""
fi
for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
- if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service \) ] ; then
- echo -n "$i: " ; systemctl ${OPTS} mask $i.service
+ if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service ] ; then
+ echo -n "$i: "
+ systemctl $OPTS mask $i.service
fi
- done ; echo
+ done
+ echo
}
-RDPEPENDS_${PN} = "systemd"
+RDEPENDS_${PN} = "systemd"