diff options
author | Ross Burton <ross.burton@intel.com> | 2013-10-16 14:07:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-16 14:51:07 +0100 |
commit | 529bf977e956175bd8405ebffc88194192e44740 (patch) | |
tree | e0a1c9e8892d58222fe33139cd463288991dbd11 /meta/classes/update-rc.d.bbclass | |
parent | 68a41d2afd3392c59f78398913aa3855225cc52d (diff) | |
download | poky-529bf977e956175bd8405ebffc88194192e44740.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.
(From OE-Core rev: 2b179d90eacc58f0b217f64407782a9174362850)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/update-rc.d.bbclass')
-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" | |||
13 | INIT_D_DIR = "${sysconfdir}/init.d" | 13 | INIT_D_DIR = "${sysconfdir}/init.d" |
14 | 14 | ||
15 | updatercd_postinst() { | 15 | updatercd_postinst() { |
16 | IN_TARGET=`test "x$D" = "x"` | ||
17 | |||
18 | # test if there is a previous init script there, ie, we are updating the package | 16 | # test if there is a previous init script there, ie, we are updating the package |
19 | # if so, we stop the service and remove it before we install from the new package | 17 | # if so, we stop the service and remove it before we install from the new package |
20 | if type update-rc.d >/dev/null 2>/dev/null; then | 18 | if type update-rc.d >/dev/null 2>/dev/null; then |
21 | if [ $IN_TARGET -a `test -f "${INIT_D_DIR}/${INITSCRIPT_NAME}"` ]; then | 19 | if [ -z "$D" -a `test -f "${INIT_D_DIR}/${INITSCRIPT_NAME}"` ]; then |
22 | ${INIT_D_DIR}/${INITSCRIPT_NAME} stop | 20 | ${INIT_D_DIR}/${INITSCRIPT_NAME} stop |
23 | fi | 21 | fi |
24 | if [ ! $IN_TARGET ]; then | 22 | if [ -n "$D" ]; then |
25 | OPT="-f -r $D" | 23 | OPT="-f -r $D" |
26 | else | 24 | else |
27 | OPT="-f" | 25 | OPT="-f" |
@@ -29,7 +27,7 @@ if type update-rc.d >/dev/null 2>/dev/null; then | |||
29 | update-rc.d $OPT ${INITSCRIPT_NAME} remove | 27 | update-rc.d $OPT ${INITSCRIPT_NAME} remove |
30 | fi | 28 | fi |
31 | 29 | ||
32 | if [ ! $IN_TARGET ]; then | 30 | if [ -n "$D" ]; then |
33 | OPT="-r $D" | 31 | OPT="-r $D" |
34 | else | 32 | else |
35 | OPT="-s" | 33 | OPT="-s" |