[OE-core] [PATCH] mdadm: Add systemd support

Pau Espin Pedrol pespin.shar at gmail.com
Thu Feb 4 21:12:02 UTC 2016


Please use ${systemd_system_unitdir} instead of ${systemd_unitdir}/system

Pau Espin Pedrol
mail/jabber: pespin.shar at gmail.com
http://blog.espeweb.net

2016-02-02 3:22 GMT+01:00 Li Xin <lixin.fnst at cn.fujitsu.com>:

> Add mdadm.service to support systemd systems and add configuration
> file.
>
> Signed-off-by: Li Xin <lixin.fnst at cn.fujitsu.com>
> ---
>  meta/recipes-extended/mdadm/files/mdadm.service | 13 +++++++++++++
>  meta/recipes-extended/mdadm/mdadm_3.3.4.bb      | 12 +++++++++++-
>  2 files changed, 24 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-extended/mdadm/files/mdadm.service
>
> diff --git a/meta/recipes-extended/mdadm/files/mdadm.service
> b/meta/recipes-extended/mdadm/files/mdadm.service
> new file mode 100644
> index 0000000..3664ceb
> --- /dev/null
> +++ b/meta/recipes-extended/mdadm/files/mdadm.service
> @@ -0,0 +1,13 @@
> +[Unit]
> +Description=Software RAID monitoring and management
> +After=syslog.target
> +ConditionPathExists=@sysconfdir@/mdadm.conf
> +
> +[Service]
> +Type=forking
> +PIDFile=@localstatedir@/run/mdadm/mdadm.pid
> +EnvironmentFile=- at sysconfdir@/sysconfig/mdmonitor
> +ExecStart=@basesbindir@/mdadm --monitor --scan -f
> --pid-file=@localstatedir@/run/mdadm/mdadm.pid
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
> b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
> index 1198167..e27f384 100644
> --- a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
> +++ b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
> @@ -14,13 +14,14 @@ SRC_URI =
> "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
>             file://mdadm-3.3.2_x32_abi_time_t.patch \
>             file://0001-Fix-typo-in-comparision.patch \
>             file://run-ptest \
> +           file://mdadm.service \
>           "
>  SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09"
>  SRC_URI[sha256sum] =
> "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68"
>
>  CFLAGS += "-fno-strict-aliasing"
>
> -inherit autotools-brokensep
> +inherit autotools-brokensep systemd
>
>  EXTRA_OEMAKE = "CHECK_RUN_DIR=0"
>  # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's
> asm/types.h
> @@ -38,8 +39,17 @@ do_compile() {
>  do_install() {
>         export STRIP=""
>         autotools_do_install
> +        install -d ${D}/${sysconfdir}/
> +        install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/
> +        install -d ${D}${systemd_unitdir}/system
> +        install -m 644 ${WORKDIR}/mdadm.service
> ${D}${systemd_unitdir}/system/
> +        sed -i -e 's, at basesbindir@,${base_sbindir},g' \
> +               -e 's, at localstatedir@,${localstatedir},g' \
> +               -e 's, at sysconfdir@,${sysconfdir},g' \
> +               ${D}${systemd_unitdir}/system/mdadm.service
>  }
>
> +SYSTEMD_SERVICE_${PN} = "mdadm.service"
>  FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
>
>  inherit ptest
> --
> 1.8.4.2
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160204/06a2420d/attachment-0002.html>


More information about the Openembedded-core mailing list