diff options
author | Ross Burton <ross.burton@intel.com> | 2013-10-16 14:07:51 +0100 |
---|---|---|
committer | Andreas Oberritter <obi@opendreambox.org> | 2015-02-23 16:51:50 +0100 |
commit | a940bd43ad7a245084f2682f718797f1ececa5ae (patch) | |
tree | 2c14f9024e9f922a648f912c2f21d51a2e306afd /meta | |
parent | d55236535cb839fc515c9017ce738173460c7ae4 (diff) | |
download | openembedded-core-contrib-a940bd43ad7a245084f2682f718797f1ececa5ae.tar.gz |
update-rcd.bbclass: fix host/target test
"update-rc: Stop and remove service if updating package" (oe-core d91b08) had a
bug in it's implementation of a "host or target" test which always resulted in
"target", so the rootfs scripts were attempting to restart daemons on the host.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2b179d90eacc58f0b217f64407782a9174362850)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/update-rc.d.bbclass | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass index d44d36cb5b..e14659d118 100644 --- a/meta/classes/update-rc.d.bbclass +++ b/meta/classes/update-rc.d.bbclass @@ -13,15 +13,13 @@ INITSCRIPT_PARAMS ?= "defaults" INIT_D_DIR = "${sysconfdir}/init.d" updatercd_postinst() { -IN_TARGET=`test "x$D" = "x"` - # test if there is a previous init script there, ie, we are updating the package # if so, we stop the service and remove it before we install from the new package if type update-rc.d >/dev/null 2>/dev/null; then - if [ $IN_TARGET -a `test -f "${INIT_D_DIR}/${INITSCRIPT_NAME}"` ]; then + if [ -z "$D" -a `test -f "${INIT_D_DIR}/${INITSCRIPT_NAME}"` ]; then ${INIT_D_DIR}/${INITSCRIPT_NAME} stop fi - if [ ! $IN_TARGET ]; then + if [ -n "$D" ]; then OPT="-f -r $D" else OPT="-f" @@ -29,7 +27,7 @@ if type update-rc.d >/dev/null 2>/dev/null; then update-rc.d $OPT ${INITSCRIPT_NAME} remove fi -if [ ! $IN_TARGET ]; then +if [ -n "$D" ]; then OPT="-r $D" else OPT="-s" |