diff options
Diffstat (limited to 'meta/classes/update-rc.d.bbclass')
| -rw-r--r-- | meta/classes/update-rc.d.bbclass | 28 |
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 | ||
| 23 | updatercd_preinst() { | ||
| 24 | if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then | ||
| 25 | ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || : | ||
| 26 | fi | ||
| 27 | if ${@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 | ||
| 34 | fi | ||
| 35 | } | ||
| 36 | |||
| 37 | PACKAGE_WRITE_DEPS += "update-rc.d-native" | 23 | PACKAGE_WRITE_DEPS += "update-rc.d-native" |
| 38 | 24 | ||
| 39 | updatercd_postinst() { | 25 | updatercd_postinst() { |
| 40 | if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then | 26 | if ${@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} |
| 47 | fi | 33 | fi |
| @@ -79,7 +65,7 @@ python __anonymous() { | |||
| 79 | PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}" | 65 | PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}" |
| 80 | PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd " | 66 | PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd " |
| 81 | 67 | ||
| 82 | populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst" | 68 | populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_postinst" |
| 83 | populate_packages_updatercd[vardepsexclude] += "OVERRIDES" | 69 | populate_packages_updatercd[vardepsexclude] += "OVERRIDES" |
| 84 | 70 | ||
| 85 | python populate_packages_updatercd () { | 71 | python 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' |
