summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-extended/sanlock
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-extended/sanlock')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch80
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch51
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb36
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb45
4 files changed, 96 insertions, 116 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch
deleted file mode 100644
index e4bde80a..00000000
--- a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From c51c2c543f3c78b2a68acc61f786f903f2e0fec8 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Sun, 9 Sep 2018 07:28:09 -0400
-Subject: [PATCH] fix compile failure with libc musl
-
-The lack of random_r in musl:
-[snip]
-|main.c:1393:7: warning: implicit declaration of function 'random_r';
-did you mean 'random'? [-Wimplicit-function-declaration]
-| rv = random_r(&rand_data, &val);
-| ^~~~~~~~
-| random
-|main.c:1408:30: error: invalid application of 'sizeof' to incomplete
-type 'struct random_data'
-| memset(&rand_data, 0, sizeof(rand_data));
-[snip]
-
-s/random_r/random/, s/initstate_r/initstate/ and remove `static struct
-random_data rand_data'
-
-Here is the man of `random_r()':
-[snip]
-The random_r() function is like random(3), except that instead of using
-state information maintained in a global variable
-[snip]
-
-So use random without state information is OK.
-
-Upstream-Status: Submitted [sanlock-devel@lists.fedorahosted.org]
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- src/main.c | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/src/main.c b/src/main.c
-index f60b4d3..602c400 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -84,7 +84,6 @@ static char command[COMMAND_MAX];
- static int cmd_argc;
- static char **cmd_argv;
- static struct thread_pool pool;
--static struct random_data rand_data;
- static char rand_state[32];
- static pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER;
- static const char *run_dir = NULL;
-@@ -1386,16 +1385,15 @@ int get_rand(int a, int b);
-
- int get_rand(int a, int b)
- {
-- int32_t val;
-- int rv;
-+ long int rv;
-
- pthread_mutex_lock(&rand_mutex);
-- rv = random_r(&rand_data, &val);
-+ rv = random();
- pthread_mutex_unlock(&rand_mutex);
- if (rv < 0)
- return rv;
-
-- return a + (int) (((float)(b - a + 1)) * val / (RAND_MAX+1.0));
-+ return a + (int) (((float)(b - a + 1)) * rv / (RAND_MAX+1.0));
- }
-
- static void setup_host_name(void)
-@@ -1405,9 +1403,7 @@ static void setup_host_name(void)
- uuid_t uu;
-
- memset(rand_state, 0, sizeof(rand_state));
-- memset(&rand_data, 0, sizeof(rand_data));
--
-- initstate_r(time(NULL), rand_state, sizeof(rand_state), &rand_data);
-+ initstate(time(NULL), rand_state, sizeof(rand_state));
-
- /* use host name from command line */
-
---
-2.8.1
-
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch
new file mode 100644
index 00000000..a0b721c4
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock/0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch
@@ -0,0 +1,51 @@
+From 78a9cffb1c760466933bbbcbae7ecb9b30a3e6a5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Nov 2019 13:47:42 -0800
+Subject: [PATCH] sanlock: Replace "cp -a" with "cp -R --no-dereference
+ --preserve=mode, links"
+
+Using "cp -a" leaks UID of user running the builds
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile | 8 ++++----
+ wdmd/Makefile | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 533dd79..2fc9ba5 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -127,9 +127,9 @@ install: all
+ $(INSTALL) -c -m 755 $(LIBSO_CLIENT_TARGET) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -c -m 644 $(LIBPC_ENTIRE_TARGET) $(DESTDIR)/$(LIBDIR)/pkgconfig
+ $(INSTALL) -c -m 644 $(LIBPC_CLIENT_TARGET) $(DESTDIR)/$(LIBDIR)/pkgconfig
+- cp -a $(LIB_ENTIRE_TARGET).so $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_CLIENT_TARGET).so $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_CLIENT_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_ENTIRE_TARGET).so $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_CLIENT_TARGET).so $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_CLIENT_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -c -m 644 $(HEADER_TARGET) $(DESTDIR)/$(HEADIR)
+ $(INSTALL) -m 644 $(MAN_TARGET) $(DESTDIR)/$(MANDIR)/man8/
+diff --git a/wdmd/Makefile b/wdmd/Makefile
+index 5849efc..4894517 100644
+--- a/wdmd/Makefile
++++ b/wdmd/Makefile
+@@ -68,7 +68,7 @@ install: all
+ $(INSTALL) -d $(DESTDIR)/$(MANDIR)/man8
+ $(INSTALL) -c -m 755 $(CMD_TARGET) $(DESTDIR)/$(BINDIR)
+ $(INSTALL) -c -m 755 $(SHLIB_TARGET) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_TARGET).so $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_TARGET).so $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_TARGET).so.$(SOMAJOR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -c -m 644 $(HEADER_TARGET) $(DESTDIR)/$(HEADIR)
+ $(INSTALL) -m 644 $(MAN_TARGET) $(DESTDIR)/$(MANDIR)/man8
+--
+2.24.0
+
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb
deleted file mode 100644
index c51bccce..00000000
--- a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "A shared storage lock manager"
-DESCRIPTION = "sanlock is a lock manager built on shared storage. Hosts with access \
-to the storage can perform locking. An application running on the \
-hosts is given a small amount of space on the shared block device or \
-file, and uses sanlock for its own application-specific synchronization. \
-Internally, the sanlock daemon manages locks using two disk-based \
-lease algorithms: delta leases and paxos leases."
-HOMEPAGE = "https://pagure.io/sanlock"
-SECTION = "utils"
-
-LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
-LIC_FILES_CHKSUM = "file://README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22"
-
-SRC_URI = "git://pagure.io/sanlock.git;protocol=http \
- file://0001-fix-compile-failure-with-libc-musl.patch \
- "
-SRCREV = "90b2ffa77edd46bea007b7bb39bfd4d2db2ff7af"
-S = "${WORKDIR}/git"
-
-DEPENDS = "libaio util-linux"
-
-inherit distutils
-
-do_configure[noexec] = "1"
-
-do_compile_prepend () {
- oe_runmake -C wdmd CMD_LDFLAGS="${LDFLAGS}" LIB_LDFLAGS="${LDFLAGS}"
- oe_runmake -C src CMD_LDFLAGS="${LDFLAGS}" LIB_ENTIRE_LDFLAGS="${LDFLAGS}" LIB_CLIENT_LDFLAGS="${LDFLAGS}"
- cd ${S}/python
-}
-
-do_install_prepend () {
- oe_runmake -C wdmd DESTDIR=${D} LIBDIR=${libdir} install
- oe_runmake -C src DESTDIR=${D} LIBDIR=${libdir} install
- cd ${S}/python
-}
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb
new file mode 100644
index 00000000..ffd46da0
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "A shared storage lock manager"
+DESCRIPTION = "sanlock is a lock manager built on shared storage. Hosts with access \
+to the storage can perform locking. An application running on the \
+hosts is given a small amount of space on the shared block device or \
+file, and uses sanlock for its own application-specific synchronization. \
+Internally, the sanlock daemon manages locks using two disk-based \
+lease algorithms: delta leases and paxos leases."
+HOMEPAGE = "https://pagure.io/sanlock"
+SECTION = "utils"
+
+LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://../README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22"
+
+PV .= "+git${SRCPV}"
+
+SRC_URI = "git://pagure.io/sanlock.git;protocol=http \
+ file://0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch;patchdir=../ \
+ "
+SRCREV = "cff348800722f7dadf030ffe7494c2df714996e3"
+
+S = "${WORKDIR}/git/python"
+
+DEPENDS = "libaio util-linux"
+
+inherit distutils3 useradd
+
+do_configure[noexec] = "1"
+
+do_compile_prepend () {
+ oe_runmake -C ${S}/../wdmd CMD_LDFLAGS="${LDFLAGS}" LIB_LDFLAGS="${LDFLAGS}"
+ oe_runmake -C ${S}/../src CMD_LDFLAGS="${LDFLAGS}" LIB_ENTIRE_LDFLAGS="${LDFLAGS}" LIB_CLIENT_LDFLAGS="${LDFLAGS}"
+}
+
+do_install_prepend () {
+ oe_runmake -C ${S}/../wdmd DESTDIR=${D} LIBDIR=${libdir} install
+ oe_runmake -C ${S}/../src DESTDIR=${D} LIBDIR=${libdir} install
+}
+
+SANLOCKGROUP ?= "sanlock"
+SANLOCKUSER ?= "sanlock"
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${SANLOCKGROUP}"
+USERADD_PARAM_${PN} = "--system -g ${SANLOCKGROUP} -G disk \
+ --home-dir /run/${SANLOCKUSER} --no-create-home \
+ --shell /sbin/nologin ${SANLOCKUSER}"