]> code.ossystems Code Review - openembedded-core.git/commitdiff
alsa-state: install init script only when 'sysvinit' is in DISTRO_FEATURES
authorChen Qi <Qi.Chen@windriver.com>
Thu, 7 Aug 2014 02:46:42 +0000 (22:46 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Aug 2014 09:46:59 +0000 (10:46 +0100)
The /etc/init.d/alsa-state is totally useless for a systemd image.
Its functionality has been replaced by alsa-state.service files.

So if 'sysvinit' is not in DISTRO_FEATURES, installing this script doesn't
make any sense.

[YOCTO #4420]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-bsp/alsa-state/alsa-state.bb

index 874d6bbe83b21d177cc3c54aeb3102a4c74b4e36..d2f8ea2be1825698dbc846471f27f7fc6b00113e 100644 (file)
@@ -24,11 +24,15 @@ INITSCRIPT_NAME = "alsa-state"
 INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
 
 do_install() {
-    sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
-    install -d ${D}${sysconfdir}/init.d
-    install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
+    # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+       sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
+       install -d ${D}${sysconfdir}/init.d
+       install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
+    fi
 
     install -d ${D}/${localstatedir}/lib/alsa
+    install -d ${D}${sysconfdir}
     install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
     install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
 }