summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-rc.d.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/update-rc.d.bbclass')
-rw-r--r--meta/classes/update-rc.d.bbclass28
1 files changed, 4 insertions, 24 deletions
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 265c4be9d1..1366fee653 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -20,28 +20,14 @@ def use_updatercd(d):
20 return '[ -n "$D" -o ! -d /run/systemd/system ]' 20 return '[ -n "$D" -o ! -d /run/systemd/system ]'
21 return 'true' 21 return 'true'
22 22
23updatercd_preinst() {
24if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
25 ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
26fi
27if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
28 if [ -n "$D" ]; then
29 OPT="-f -r $D"
30 else
31 OPT="-f"
32 fi
33 update-rc.d $OPT ${INITSCRIPT_NAME} remove
34fi
35}
36
37PACKAGE_WRITE_DEPS += "update-rc.d-native" 23PACKAGE_WRITE_DEPS += "update-rc.d-native"
38 24
39updatercd_postinst() { 25updatercd_postinst() {
40if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then 26if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
41 if [ -n "$D" ]; then 27 if [ -n "$D" ]; then
42 OPT="-f -r $D" 28 OPT="-r $D"
43 else 29 else
44 OPT="-f -s" 30 OPT="-s"
45 fi 31 fi
46 update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} 32 update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
47fi 33fi
@@ -79,7 +65,7 @@ python __anonymous() {
79PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}" 65PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}"
80PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd " 66PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
81 67
82populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst" 68populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_postinst"
83populate_packages_updatercd[vardepsexclude] += "OVERRIDES" 69populate_packages_updatercd[vardepsexclude] += "OVERRIDES"
84 70
85python populate_packages_updatercd () { 71python populate_packages_updatercd () {
@@ -95,7 +81,7 @@ python populate_packages_updatercd () {
95 d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix)) 81 d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix))
96 82
97 def update_rcd_package(pkg): 83 def update_rcd_package(pkg):
98 bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg) 84 bb.debug(1, 'adding update-rc.d calls to postinst/prerm/postrm for %s' % pkg)
99 85
100 localdata = bb.data.createCopy(d) 86 localdata = bb.data.createCopy(d)
101 overrides = localdata.getVar("OVERRIDES") 87 overrides = localdata.getVar("OVERRIDES")
@@ -103,12 +89,6 @@ python populate_packages_updatercd () {
103 89
104 update_rcd_auto_depend(pkg) 90 update_rcd_auto_depend(pkg)
105 91
106 preinst = d.getVar('pkg_preinst_%s' % pkg)
107 if not preinst:
108 preinst = '#!/bin/sh\n'
109 preinst += localdata.getVar('updatercd_preinst')
110 d.setVar('pkg_preinst_%s' % pkg, preinst)
111
112 postinst = d.getVar('pkg_postinst_%s' % pkg) 92 postinst = d.getVar('pkg_postinst_%s' % pkg)
113 if not postinst: 93 if not postinst:
114 postinst = '#!/bin/sh\n' 94 postinst = '#!/bin/sh\n'