[oe] [meta-networking][PATCH] drbd: Add recipes

Bian, Naimeng biannm at cn.fujitsu.com
Thu Dec 11 07:43:56 UTC 2014


> -----Original Message-----
> From: openembedded-devel-bounces at lists.openembedded.org
> [mailto:openembedded-devel-bounces at lists.openembedded.org] On Behalf Of Khem
> Raj
> Sent: Thursday, December 11, 2014 11:28 AM
> To: openembedded-devel at lists.openembedded.org
> Subject: Re: [oe] [meta-networking][PATCH] drbd: Add recipes
> 
> 
> > On Dec 10, 2014, at 7:20 PM, Bian Naimeng <biannm at cn.fujitsu.com> wrote:
> >
> > DRBD is a block device which is designed to build high availability clusters.
> >
> > Signed-off-by: Bian Naimeng <biannm at cn.fujitsu.com>
> > ---
> > .../recipes-support/drbd/drbd/drbd.service         | 12 +++++
> > meta-networking/recipes-support/drbd/drbd_8.4.4.bb | 55
> > ++++++++++++++++++++++
> > 2 files changed, 67 insertions(+)
> > create mode 100644
> > meta-networking/recipes-support/drbd/drbd/drbd.service
> > create mode 100644 meta-networking/recipes-support/drbd/drbd_8.4.4.bb
> >
> > diff --git a/meta-networking/recipes-support/drbd/drbd/drbd.service
> > b/meta-networking/recipes-support/drbd/drbd/drbd.service
> > new file mode 100644
> > index 0000000..6b6ab30
> > --- /dev/null
> > +++ b/meta-networking/recipes-support/drbd/drbd/drbd.service
> > @@ -0,0 +1,12 @@
> > +[Unit]
> > +Description=DRBD Service
> > +After=network.target
> > +
> > +[Service]
> > +Type=oneshot
> > +RemainAfterExit=yes
> > +ExecStart=@LIBEXECDIR@/drbd-helper startxxx
> 
> is that a typo ? or did you mean startxxx

Sorry, and thanks for your review.
I will fix it in the next version.

> 
> > +ExecStop=@LIBEXECDIR@/drbd-helper stop
> > +
> > +[Install]
> > +WantedBy=multi-user.target
> > diff --git a/meta-networking/recipes-support/drbd/drbd_8.4.4.bb
> > b/meta-networking/recipes-support/drbd/drbd_8.4.4.bb
> > new file mode 100644
> > index 0000000..c7a6973
> > --- /dev/null
> > +++ b/meta-networking/recipes-support/drbd/drbd_8.4.4.bb
> > @@ -0,0 +1,55 @@
> > +SUMMARY = "BD driver for Linux"
> > +DESCRIPTION = "DRBD mirrors a block device over the network to
> > +another machine.\ DRBD mirrors a block device over the network to
> > +another machine.\ Think of it as networked raid 1. It is a building
> > +block for\ setting up high availability (HA) clusters."
> > +
> > +HOMEPAGE = "http://www.drbd.org/"
> > +SECTION = "kernel/userland"
> > +
> > +RDEPENDS_${PN} += "bash perl"
> > +
> > +LICENSE = "GPLv2+"
> > +
> > +LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
> > +
> > +SRC_URI = "http://oss.linbit.com/${BPN}/8.4/${BPN}-${PV}.tar.gz \
> > +           file://drbd.service \
> > +          "
> > +
> > +SRC_URI[md5sum] = "b51815343c1a9151e2936b3b97520388"
> > +SRC_URI[sha256sum] =
> "a056219c5c23b079c3354179f7a1b9f55d47e573a4cd3178f2ef4c15604288f0"
> > +
> > +inherit autotools-brokensep systemd
> 
> why brokensep ?

The makefile.in of drbd uses the relative path to point source files.
Compile errors will be caught if we build it on ${B} such as following.
---------------------------------------------------------------------
| NOTE: make -j 4
| /bin/sed: can't read drbd/linux/drbd_config.h: No such file or directory
| make -C drbd drbd_buildtag.c
| make: *** drbd: No such file or directory.  Stop.
| make: *** [drbd/drbd_buildtag.c] Error 2
----------------------------------------------------------------------

> 
> > +
> > +EXTRA_OECONF = "--with-utils                  \
> > +                --without-km                  \
> > +                --with-initdir=/etc/init.d    \
> > +                --without-pacemaker           \
> > +                --without-rgmanager           \
> > +                --without-bashcompletion      \
> > +                --with-distro debian          \
> > +               "
> > +
> > +do_configure (){
> > +    oe_runconf
> > +}
> > +
> > +SYSTEMD_SERVICE_${PN} = "drbd.service"
> > +SYSTEMD_AUTO_ENABLE = "disable"
> > +
> > +do_install_append() {
> > +    if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)};
> then
> > +        install -d ${D}/${systemd_unitdir}/system
> > +        install -m 644 ${WORKDIR}/drbd.service
> ${D}/${systemd_unitdir}/system
> > +        install -d ${D}/${libexecdir}
> > +        install -m 755 ${D}/${sysconfdir}/init.d/drbd
> > +${D}/${libexecdir}/drbd-helper
> > +
> > +        sed -i -e 's, at LIBEXECDIR@,${libexecdir},g' \
> > +            ${D}${systemd_unitdir}/system/drbd.service
> > +    fi
> > +}
> > +
> > +FILES_${PN} += “run"
> 
> should this be relative to prefix or something ?

Sorry, it should be "/run".
I will fix it in the next version.

Thanks,
 Bian

> 
> > +FILES_${PN} += "${base_libdir}/drbd"
> > +FILES_${PN}-dbg += "${base_libdir}/drbd/.debug"
> > --
> > 1.9.1
> >
> > --
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> 
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


More information about the Openembedded-devel mailing list