Skip to contentSkip to conversation

dlm: Build fence only when pacemaker recipe is available

PATCH New Khem Raj 1 participant 2 messages Aug 19, 2018

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 dlm: Build fence only when pacemaker recipe is available

pacemaker is not in meta-networking, and therefore dlm fails to build when meta-cgl is not included, this changeset makes the pacemaker dependency to be optional, and disabled by default so users who have pacemaker in the bbfiles should enable pacemaker support via a bbappend or setting it in config metadata

---
 meta-networking/recipes-extended/dlm/dlm_4.0.7.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta-networking/recipes-extended/dlm/dlm_4.0.7.bb +8 -1
index f7f7e188c5..18843a61f8 100644
@@ -20,17 +20,24 @@ UPSTREAM_CHECK_REGEX = "dlm-(?P<pver>\d+(\.\d+)+)"
 LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
 LIC_FILES_CHKSUM = "file://README.license;md5=8f0bbcdd678df1bce9863492b6c8832d"
 
-DEPENDS = "corosync systemd pacemaker"
+DEPENDS = "corosync systemd"
 
 inherit pkgconfig systemd distro_features_check
 
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[pacemaker] = ",,pacemaker"
+
 SYSTEMD_SERVICE_${PN} = "dlm.service"
 SYSTEMD_AUTO_ENABLE = "enable"
 
 export EXTRA_OEMAKE = ""
 
+DONTBUILD = "${@bb.utils.contains('PACKAGECONFIG', 'pacemaker', '', 'fence', d)}"
+
 do_compile_prepend() {
     sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile
+    sed -i -e "s/ ${DONTBUILD}//g" ${S}/Makefile
 }
 
 do_compile () {
Signature · 1 line
2.18.0
author
#1 lore raw

PATCH 2/2 dlm: Fix build with glibc 2.28+

---
 ...acros.h-for-major-minor-macros-in-gl.patch | 41 +++++++++++++++++++
 .../recipes-extended/dlm/dlm_4.0.7.bb         |  3 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch
meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch new file +41 -0
new file mode 100644
index 0000000000..6f9a0a45a3
@@ -0,0 +1,41 @@
+From a55ab8a07770296bf6a622df14f2f0445be16327 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 19 Aug 2018 15:58:49 -0700
+Subject: [PATCH] Include sys/sysmacros.h for major/minor macros in glibc 2.25+
+
+sys/sysmacros.h was included though sys/types.h until 2.28
+glibc release removed it therefore it must be included
+explicitly now.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ dlm_controld/action.c | 2 ++
+ libdlm/libdlm.c       | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/dlm_controld/action.c b/dlm_controld/action.c
+index 84637f1..2b8ad6c 100644
+--- a/dlm_controld/action.c
++++ b/dlm_controld/action.c
+@@ -8,6 +8,8 @@
+ 
+ #include "dlm_daemon.h"
+ 
++#include <sys/sysmacros.h>
++
+ #include <corosync/corotypes.h>
+ #include <corosync/cmap.h>
+ 
+diff --git a/libdlm/libdlm.c b/libdlm/libdlm.c
+index a9e6195..499eb6a 100644
+--- a/libdlm/libdlm.c
++++ b/libdlm/libdlm.c
+@@ -14,6 +14,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <inttypes.h>
meta-networking/recipes-extended/dlm/dlm_4.0.7.bb +2 -1
index 18843a61f8..027864a1a7 100644
@@ -9,7 +9,8 @@ SRC_URI = "https://releases.pagure.org/dlm/${BP}.tar.gz \
            file://respect-ldflags-also-from-bin_ldflags.patch \
            file://0001-dlm-fix-compile-error-since-xml2-config-should-not-b.patch \
            file://0001-dlm-fix-package-qa-error.patch \
-"
+           file://0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch \
+           "
 
 SRC_URI[md5sum] = "aa604a10d5ac2d3414eb89ec6984cd12"
 SRC_URI[sha256sum] = "639ddfc82369272a68d56816689736c00b8f1b6b2869a6b66b7dbf6dad86469a"
Signature · 1 line
2.18.0