diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-09-03 15:09:02 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-09-03 11:09:04 +0100 |
commit | e3088a7608073be26edc56f94da39f885f5ab0d4 (patch) | |
tree | e1f62f64c004ecde6a02b25637e4c3658b62efb6 /meta/recipes-bsp | |
parent | ee05cc83596744b94ad7c107d5bdc2d9136744fe (diff) | |
download | poky-e3088a7608073be26edc56f94da39f885f5ab0d4.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.
(From OE-Core rev: 9b9da6667b606a56c89abc1b458f52dcca9774e9)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r-- | meta/recipes-bsp/alsa-state/alsa-state.bb | 11 |
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 = "\ | |||
18 | file://alsa-state-init \ | 18 | file://alsa-state-init \ |
19 | " | 19 | " |
20 | 20 | ||
21 | # As the recipe doesn't inherit systemd.bbclass, we need to set this variable | ||
22 | # manually to avoid unnecessary postinst/preinst generated. | ||
23 | python __anonymous() { | ||
24 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
25 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
26 | } | ||
27 | |||
21 | inherit update-rc.d | 28 | inherit update-rc.d |
22 | 29 | ||
23 | INITSCRIPT_NAME = "alsa-state" | 30 | INITSCRIPT_NAME = "alsa-state" |
@@ -54,9 +61,5 @@ pkg_postinst_${PN}() { | |||
54 | then | 61 | then |
55 | ${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore | 62 | ${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore |
56 | fi | 63 | fi |
57 | # INITSCRIPT_PARAMS changed, so remove the old and | ||
58 | # install the new setting. | ||
59 | update-rc.d -f ${INITSCRIPT_NAME} remove | ||
60 | update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} | ||
61 | fi | 64 | fi |
62 | } | 65 | } |