[OE-core] [PATCH 1/2] mdadm: guarded with systemd when install mdadm service

Liwei Song liwei.song at windriver.com
Wed May 22 09:04:24 UTC 2019


install mdadm related service only when systemd was included
in DISTRO_FEATURES.

Signed-off-by: Liwei Song <liwei.song at windriver.com>
---
 meta/recipes-extended/mdadm/mdadm_4.1.bb | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 597faf787a67..8ca42a89ddc5 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -59,13 +59,11 @@ do_install_append() {
         install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf
         install -d ${D}/${sysconfdir}/init.d
         install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor
+        if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then
+               oe_runmake install-systemd DESTDIR=${D}
+        fi
 }
 
-do_install_append() {
-        oe_runmake install-systemd DESTDIR=${D}
-}
-
-
 do_compile_ptest() {
 	oe_runmake test
 }
@@ -93,4 +91,4 @@ RRECOMMENDS_${PN}-ptest += " \
     kernel-module-raid456 \
 "
 
-FILES_${PN} += "/lib/systemd/*"
+FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','/lib/systemd/*', '', d)}"
-- 
2.7.4



More information about the Openembedded-core mailing list