aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-08-13 23:05:33 -0400
committerChen Qi <Qi.Chen@windriver.com>2014-09-03 15:05:41 +0800
commit47fd789633fefe49298ad639b01bd9d9d5c2f39d (patch)
tree20495fdd97e2525e32425fae73be9cbe9adc8bb7
parentf203ba854e5e6b847c43350c722c9bf22f334c10 (diff)
downloadopenembedded-core-contrib-47fd789633fefe49298ad639b01bd9d9d5c2f39d.tar.gz
alsa-state: fix pkg_postinst and set INHIBIT_UPDATERCD_BBCLASS
As alsa-state inherits update-rc.d, the update-rc.d part inpostinst script has already been handled in update-rc.d.bbclass. Besides, we need to set INHIBIT_UPDATERCD_BBCLASS to "1" if 'sysvinit' is not in DISTRO_FEATURES. This is because the init script is not installed in such situation, adding update-rc.d part in the preinst/postinst scripts just makes no sense. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-rw-r--r--meta/recipes-bsp/alsa-state/alsa-state.bb11
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
index d2f8ea2be1..17c2d002d5 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state.bb
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -18,6 +18,13 @@ SRC_URI = "\
file://alsa-state-init \
"
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
inherit update-rc.d
INITSCRIPT_NAME = "alsa-state"
@@ -54,9 +61,5 @@ pkg_postinst_${PN}() {
then
${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
fi
- # INITSCRIPT_PARAMS changed, so remove the old and
- # install the new setting.
- update-rc.d -f ${INITSCRIPT_NAME} remove
- update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
fi
}