summaryrefslogtreecommitdiff
path: root/classes/update-rc.d.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/update-rc.d.bbclass')
-rw-r--r--classes/update-rc.d.bbclass17
1 files changed, 13 insertions, 4 deletions
diff --git a/classes/update-rc.d.bbclass b/classes/update-rc.d.bbclass
index 91af859392..4594d0f3b3 100644
--- a/classes/update-rc.d.bbclass
+++ b/classes/update-rc.d.bbclass
@@ -1,4 +1,4 @@
-DEPENDS_append = " update-rc.d"
+DEPENDS_append = " update-rc.d update-rc.d-native"
RDEPENDS_${PN}_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
INITSCRIPT_PARAMS ?= "defaults"
@@ -16,22 +16,31 @@ update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
updatercd_prerm() {
if test "x$D" = "x"; then
- ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+ fi
fi
}
+# Note: to be Debian compliant, we should only invoke update-rc.d remove
+# at the "purge" step, but opkg does not support it. So instead we also
+# run it at the "remove" step if the init script no longer exists.
+
updatercd_postrm() {
if test "x$D" != "x"; then
OPT="-r $D"
else
OPT=""
fi
-update-rc.d $OPT ${INITSCRIPT_NAME} remove
+if test "$1" = "remove" -o "$1" = "purge"; then
+ if ! test -e "${INIT_D_DIR}/${INITSCRIPT_NAME}"; then
+ update-rc.d $OPT ${INITSCRIPT_NAME} remove
+ fi
+fi
}
def update_rc_after_parse(d):
- import bb
if bb.data.getVar('INITSCRIPT_PACKAGES', d) == None:
if bb.data.getVar('INITSCRIPT_NAME', d) == None:
raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % bb.data.getVar('FILE', d)