From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- ...drbd-tools-only-rmmod-if-DRBD-is-a-module.patch | 43 +++++++++++++++ .../recipes-support/drbd/drbd-utils_9.5.0.bb | 63 ++++++++++++++++++++++ ...ck_existence_of_modules_before_installing.patch | 24 +++++++++ .../recipes-support/drbd/drbd_9.0.8-1.bb | 24 +++++++++ 4 files changed, 154 insertions(+) create mode 100644 external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-drbd-drbd-tools-only-rmmod-if-DRBD-is-a-module.patch create mode 100644 external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_9.5.0.bb create mode 100644 external/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch create mode 100644 external/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb (limited to 'external/meta-openembedded/meta-networking/recipes-support/drbd') diff --git a/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-drbd-drbd-tools-only-rmmod-if-DRBD-is-a-module.patch b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-drbd-drbd-tools-only-rmmod-if-DRBD-is-a-module.patch new file mode 100644 index 00000000..c0f3adf2 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-drbd-drbd-tools-only-rmmod-if-DRBD-is-a-module.patch @@ -0,0 +1,43 @@ +Subject: drbd-tools: only rmmod if DRBD is a module + +Account for the case if the DRBD drive is built into +the kernel. Otherwise, errors, like the following, +will occur: + +root@localhost:~# /etc/init.d/drbd stop + Stopping all DRBD resources: ERROR: Module drbd + does not exist in /proc/modules + +Upstream-Status: Submitted [https://github.com/LINBIT/drbd-utils/pull/2] + +Signed-off-by: Aws Ismail +Signed-off-by: Jason Wessel + +[ refresh to 8.4.4: squash Aws' and Jason's patches ] +Signed-off-by: Michel Thebeau + +Signed-off-by: Chen Qi +Signed-off-by: Changqing Li + +--- + scripts/drbd | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/scripts/drbd b/scripts/drbd +index 20bf628..de589dc 100755 +--- a/scripts/drbd ++++ b/scripts/drbd +@@ -241,7 +241,9 @@ case "$1" in + if [ -d /sys/module/drbd/holders ]; then + (cd /sys/module/drbd/holders; for tr in *; do [ -d ${tr} ] && ${RMMOD} ${tr}; done) + fi +- $RMMOD drbd && break ++ if [ ! -z "$(cat /proc/modules | grep -w drbd)" ]; then ++ $RMMOD drbd && break ++ fi + fi + done + run_hook stop +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_9.5.0.bb b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_9.5.0.bb new file mode 100644 index 00000000..bd1e8576 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_9.5.0.bb @@ -0,0 +1,63 @@ +SUMMARY = "Distributed block device 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 = "admin" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018" + +SRC_URI = "git://github.com/LINBIT/drbd-utils;name=drbd-utils \ + git://github.com/LINBIT/drbd-headers;name=drbd-headers;destsuffix=git/drbd-headers \ + file://0001-drbd-drbd-tools-only-rmmod-if-DRBD-is-a-module.patch \ + " +# v9.5.0 +SRCREV_drbd-utils = "ee126652638328b55dc6bff47d07d6161ab768db" +SRCREV_drbd-headers = "b47cc11bcabe1a65c40ad23f71dcaf2da6419630" + +S = "${WORKDIR}/git" + +UPSTREAM_CHECK_URI = "https://github.com/LINBIT/drbd-utils/releases" + +SYSTEMD_SERVICE_${PN} = "drbd.service" +SYSTEMD_AUTO_ENABLE = "disable" + +inherit autotools-brokensep systemd + +EXTRA_OECONF = " \ + --with-initdir=/etc/init.d \ + --without-pacemaker \ + --without-rgmanager \ + --without-bashcompletion \ + --with-distro debian \ + --with-initscripttype=both \ + --with-systemdunitdir=${systemd_unitdir}/system \ + --without-manual \ + " + +do_configure_prepend() { + # move the the file under folder /lib/drbd/ to /usr/lib/drbd when usrmerge enabled + if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then + for m_file in `find ${S} -name 'Makefile.in'`; do + sed -i -e "s;\$(DESTDIR)\/lib\/drbd;\$(DESTDIR)\${nonarch_libdir}\/drbd;g" $m_file + done + # move the the file under folder /lib/udev/ to /usr/lib/udev when usrmerge enabled + sed -i -e "s;default_udevdir=/lib/udev;default_udevdir=\${prefix}/lib/udev;g" ${S}/configure.ac + fi + +} +do_install_append() { + # don't install empty /var/lock to avoid conflict with base-files + rm -rf ${D}${localstatedir}/lock +} + +RDEPENDS_${PN} += "bash perl-module-getopt-long perl-module-exporter perl-module-constant perl-module-overloading perl-module-exporter-heavy" + +# The drbd items are explicitly put under /lib when installed. +# +FILES_${PN} += "/run" +FILES_${PN} += "${nonarch_base_libdir}/drbd \ + ${nonarch_libdir}/drbd \ + ${nonarch_libdir}/tmpfiles.d" +FILES_${PN}-dbg += "${nonarch_base_libdir}/drbd/.debug" diff --git a/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch new file mode 100644 index 00000000..6414f730 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch @@ -0,0 +1,24 @@ +If CONFIG_BLK_DEV_DRBD kernel config is enabled, then DRBD +does not build drbd.ko here. Under this circumstance do_install +task is going to fail with a below error: +-- snip -- +| install: cannot stat ‘drbd.ko’: No such file or directory +| make[1]: *** [install] Error 1 +-- snip -- + +So, check for kernel module existence before installing. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Jagadeesh Krishnanjanappa +--- drbd-9.0.1-1/drbd/Makefile 2016-07-03 06:54:19.421538690 -0700 ++++ drbd-9.0.1-1/drbd/Makefile_mod 2016-07-03 06:53:18.938801628 -0700 +@@ -158,7 +158,7 @@ else + fi + install -d $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR) + set -e ; for ko in $(MODOBJS); do \ +- install -m 644 $$ko $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR); \ ++ [ -e $$ko ] && install -m 644 $$ko $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR); \ + done + ifeq ($(DESTDIR),/) + ifeq ($(shell uname -r),$(KERNELRELEASE)) diff --git a/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb new file mode 100644 index 00000000..fa4d10b4 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb @@ -0,0 +1,24 @@ +SUMMARY = "Distributed block device driver for Linux" +DESCRIPTION = "DRBD is a block device which is designed to build high \ + availability clusters. This is done by mirroring a whole \ + block device via (a dedicated) network. You could see \ + it as a network raid-1." +HOMEPAGE = "http://oss.linbit.com/drbd/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018" +DEPENDS = "virtual/kernel" + +SRC_URI = "http://www.linbit.com/downloads/drbd/9.0/drbd-${PV}.tar.gz \ + file://check_existence_of_modules_before_installing.patch" + +SRC_URI[md5sum] = "c1dd58043f46e9926b579aa65d4ea980" +SRC_URI[sha256sum] = "87f72d46db9bad926415b3ab9f5f1397de8c581d2e2ec1addbdd5ce2604e6123" +inherit module + +EXTRA_OEMAKE += "KDIR='${STAGING_KERNEL_DIR}'" + +do_install () { + oe_runmake install DESTDIR="${D}" +} + +PNBLACKLIST[drbd] = "implicit declaration of function 'setup_timer'; 4.15 head file issue?" -- cgit 1.2.3-korg