mdadm: guarded with systemd when install mdadm service
PATCH 1/2 mdadm: guarded with systemd when install mdadm service
install mdadm related service only when systemd was included in DISTRO_FEATURES.
Signed-off-by Liwei Song <[email protected]>
--- meta/recipes-extended/mdadm/mdadm_4.1.bb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-extended/mdadm/mdadm_4.1.bb +4 -6
@@ -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)}"
Signature · 1 line
2.7.4
PATCH 2/2 mdadm: define MAILADDR for mdmonitor service
by default in mdmonitor.service it use mail address to report alerts but this need to set MAILADDR in /etc/mdadm.conf, or the service will be failed excuted.
This patch will set MAILADD to "root" in /etc/mdadm.conf to aviod service run with error.
Signed-off-by Liwei Song <[email protected]>
--- meta/recipes-extended/mdadm/mdadm_4.1.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-extended/mdadm/mdadm_4.1.bb +1 -0
@@ -57,6 +57,7 @@ do_install() { do_install_append() { install -d ${D}/${sysconfdir}/ install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf + sed -i "s/#MAILADDR [email protected]/MAILADDR root/" ${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
Signature · 1 line
2.7.4