summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-support/lvm2')
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch182
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch79
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch (renamed from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch)18
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch (renamed from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch)15
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch (renamed from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch)22
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf (renamed from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf)0
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb31
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc81
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch139
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch44
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb4
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb81
12 files changed, 418 insertions, 278 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
new file mode 100644
index 000000000..e86ab25e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
@@ -0,0 +1,182 @@
+From 916ea0c70fd063ab7b81f16fd917a75dc02edf4f Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 17 Mar 2017 03:18:28 +0100
+Subject: [PATCH] Avoid bashisms in init scripts
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ scripts/blk_availability_init_red_hat.in | 4 ++--
+ scripts/clvmd_init_red_hat.in | 6 +++---
+ scripts/cmirrord_init_red_hat.in | 4 ++--
+ scripts/lvm2_cluster_activation_red_hat.sh.in | 4 ++--
+ scripts/lvm2_lvmetad_init_red_hat.in | 4 ++--
+ scripts/lvm2_lvmpolld_init_red_hat.in | 4 ++--
+ scripts/lvm2_monitoring_init_red_hat.in | 4 ++--
+ scripts/lvm2_monitoring_init_rhel4 | 4 ++--
+ 8 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/scripts/blk_availability_init_red_hat.in b/scripts/blk_availability_init_red_hat.in
+index a84ffe7..6b855b7 100644
+--- a/scripts/blk_availability_init_red_hat.in
++++ b/scripts/blk_availability_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -53,6 +53,6 @@ case "$1" in
+ status)
+ ;;
+ *)
+- echo $"Usage: $0 {start|stop|status}"
++ echo "Usage: $0 {start|stop|status}"
+ ;;
+ esac
+diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
+index d7f3392..abc8011 100644
+--- a/scripts/clvmd_init_red_hat.in
++++ b/scripts/clvmd_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # clvmd - Clustered LVM Daemon init script
+ #
+@@ -161,7 +161,7 @@ restart() {
+ fi
+ }
+
+-[ "$EUID" != "0" ] && {
++[ "$(id -u)" != "0" ] && {
+ echo "clvmd init script can only be executed as root user"
+ exit 4
+ }
+@@ -206,7 +206,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++ echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ rtrn=2
+ ;;
+ esac
+diff --git a/scripts/cmirrord_init_red_hat.in b/scripts/cmirrord_init_red_hat.in
+index d4b7e37..d442cbc 100755
+--- a/scripts/cmirrord_init_red_hat.in
++++ b/scripts/cmirrord_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # chkconfig: - 22 78
+ # description: Starts and stops cmirrord
+@@ -101,7 +101,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|restart|status}"
++ echo "Usage: $0 {start|stop|restart|status}"
+ ;;
+ esac
+
+diff --git a/scripts/lvm2_cluster_activation_red_hat.sh.in b/scripts/lvm2_cluster_activation_red_hat.sh.in
+index abea026..d8cba2e 100644
+--- a/scripts/lvm2_cluster_activation_red_hat.sh.in
++++ b/scripts/lvm2_cluster_activation_red_hat.sh.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ sbindir=@sbindir@
+
+@@ -54,7 +54,7 @@ case "$1" in
+ rtrn=$?
+ ;;
+ *)
+- echo $"Usage: $0 {activate|deactivate}"
++ echo "Usage: $0 {activate|deactivate}"
+ rtrn=3
+ ;;
+ esac
+diff --git a/scripts/lvm2_lvmetad_init_red_hat.in b/scripts/lvm2_lvmetad_init_red_hat.in
+index b2f5d50..96269a9 100644
+--- a/scripts/lvm2_lvmetad_init_red_hat.in
++++ b/scripts/lvm2_lvmetad_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -105,7 +105,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++ echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ ;;
+ esac
+
+diff --git a/scripts/lvm2_lvmpolld_init_red_hat.in b/scripts/lvm2_lvmpolld_init_red_hat.in
+index c521955..cdbaece 100644
+--- a/scripts/lvm2_lvmpolld_init_red_hat.in
++++ b/scripts/lvm2_lvmpolld_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+ #
+@@ -107,7 +107,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++ echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ ;;
+ esac
+
+diff --git a/scripts/lvm2_monitoring_init_red_hat.in b/scripts/lvm2_monitoring_init_red_hat.in
+index de7ff0d..9ff6bb7 100644
+--- a/scripts/lvm2_monitoring_init_red_hat.in
++++ b/scripts/lvm2_monitoring_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
+ #
+@@ -128,7 +128,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++ echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ ;;
+ esac
+
+diff --git a/scripts/lvm2_monitoring_init_rhel4 b/scripts/lvm2_monitoring_init_rhel4
+index 8eb06c5..2e8d0f7 100644
+--- a/scripts/lvm2_monitoring_init_rhel4
++++ b/scripts/lvm2_monitoring_init_rhel4
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ #
+@@ -93,7 +93,7 @@ case "$1" in
+ ;;
+
+ *)
+- echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++ echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ ;;
+ esac
+
+--
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
new file mode 100644
index 000000000..5d72402bd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
@@ -0,0 +1,79 @@
+From e3103459416616d3b8508e7176e897b0ae6c90f2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:49:40 +0000
+Subject: [PATCH] implement libc specific reopen_stream
+
+musl defines stdin/stdio/stderr as constant types which means
+we can not assign to them as we are doing here but works ok with glibc
+therefore abstract out the _reopen_stream definition depending upon if
+we are using glibc or otherwise
+
+Origin:
+http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+---
+ lib/log/log.c | 6 ++++++
+ tools/lvmcmdline.c | 6 +++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index c933154..3581084 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -161,6 +161,7 @@ static void _check_and_replace_standard_log_streams(FILE *old_stream, FILE *new_
+ * Close and reopen standard stream on file descriptor fd.
+ */
+ int reopen_standard_stream(FILE **stream, const char *mode)
++#ifdef __GLIBC__
+ {
+ int fd, fd_copy, new_fd;
+ const char *name;
+@@ -207,6 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ *stream = new_stream;
+ return 1;
+ }
++#else
++{
++ return (freopen(NULL, mode, *stream) != NULL);
++}
++#endif
+
+ void init_log_fn(lvm2_log_fn_t log_fn)
+ {
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index 9a4deb7..f1f18e6 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -1818,7 +1818,7 @@ static int _check_standard_fds(void)
+ int err = is_valid_fd(STDERR_FILENO);
+
+ if (!is_valid_fd(STDIN_FILENO) &&
+- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++ !freopen(_PATH_DEVNULL, "r", stdin)) {
+ if (err)
+ perror("stdin stream open");
+ else
+@@ -1828,7 +1828,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDOUT_FILENO) &&
+- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stdout)) {
+ if (err)
+ perror("stdout stream open");
+ /* else no stdout */
+@@ -1836,7 +1836,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDERR_FILENO) &&
+- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stderr)) {
+ printf("stderr stream open: %s\n",
+ strerror(errno));
+ return 0;
+--
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
index 3d7176729..95dcede33 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
@@ -1,22 +1,22 @@
-From e018d055603389b22cbc3bd68b1525f3048ebee7 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:50:26 +0000
-Subject: [PATCH 3/4] Guard use of mallinfo() with __GLIBC__
+From 3ae9c0b607ec33fb07f32a41e9d28cc9068dd39a Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:52:44 +0000
+Subject: [PATCH] Guard use of mallinfo() with __GLIBC__
This API is glibc-only
Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
lib/mm/memlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
-index 969f1d7..405a7c0 100644
+index da90144..f34f890 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
-@@ -145,7 +145,7 @@ static void _touch_memory(void *mem, size_t size)
+@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, size_t size)
static void _allocate_memory(void)
{
@@ -26,5 +26,5 @@ index 969f1d7..405a7c0 100644
struct rlimit limit;
int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
--
-2.7.0
+2.12.0
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
index 2a3b84364..9ab1c06d2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
@@ -1,19 +1,20 @@
-From 9b793d5b4adc5d8b3684e7f66943e236eae7c2db Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:52:59 +0000
-Subject: [PATCH 4/4] include fcntl.h for O_* defines and fcntl() signature
+From b1ad91a059d99afd1ce25823b7c0a8d3ac63d2fd Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:55:49 +0000
+Subject: [PATCH 3/4] include fcntl.h for O_* defines and fcntl() signature
On glibc _somehow_ this header gets pulled in indirectly
Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
Upstream-Status: Pending
-
+---
libdaemon/server/daemon-server.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
-index d9d60d1..433d100 100644
+index 6af6de9..a9590e7 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -18,6 +18,7 @@
@@ -25,5 +26,5 @@ index d9d60d1..433d100 100644
#include <errno.h>
#include <pthread.h>
--
-2.7.0
+2.9.3
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
index 8db320d5e..aaeaa725d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
@@ -1,7 +1,7 @@
-From 72866782f83c8cf85b10017df461128af90cae6e Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 30 Aug 2016 22:33:47 -0400
-Subject: [PATCH] tweak MODPROBE_CMD for cross compile
+From 0012ea63f6070a5d41fa380970f9c30b953237d2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:59:40 +0000
+Subject: [PATCH 4/4] tweak MODPROBE_CMD for cross compile
Lvm uses variable MODPROBE_CMD at runtime, so build time detection of modprobe
is incorrect.
@@ -16,23 +16,23 @@ filter=["r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loo
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
- configure.in | 2 --
- 1 file changed, 2 deletions(-)
+ configure.in | 1 -
+ 1 file changed, 1 deletion(-)
diff --git a/configure.in b/configure.in
-index 8e04782..77681b0 100644
+index cc77aab..a3579f2 100644
--- a/configure.in
+++ b/configure.in
-@@ -1779,8 +1779,6 @@ if test "$UDEV_SYNC" = yes; then
+@@ -1853,7 +1853,6 @@ if test "$UDEV_SYNC" = yes; then
fi
################################################################################
-AC_PATH_TOOL(MODPROBE_CMD, modprobe)
--
+
if test -n "$MODPROBE_CMD"; then
AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
- fi
--
-2.8.1
+2.9.3
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
index 9e3b5fe29..9e3b5fe29 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
new file mode 100644
index 000000000..462e8fb01
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
@@ -0,0 +1,31 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+PACKAGECONFIG = ""
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+ --with-group= \
+ --enable-pkgconfig \
+ --with-usrlibdir=${libdir} \
+"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install_append() {
+ # Remove things unrelated to libdevmapper
+ rm -rf ${D}${sysconfdir}
+ for i in `ls ${D}${sbindir}/*`; do
+ if [ $i != ${D}${sbindir}/dmsetup ]; then
+ rm $i
+ fi
+ done
+ # Remove docs
+ rm -rf ${D}${datadir}
+}
+
+RRECOMMENDS_${PN} += "lvm2-udevrules"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
index 74b72118f..cb5a9e042 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -1,80 +1,33 @@
SECTION = "utils"
DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux."
-DEPENDS = "udev"
LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24"
+DEPENDS += "util-linux"
+
SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \
file://lvm.conf \
- file://0001-implement-libc-specific-_reopen_stream.patch \
- file://0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch \
- file://0003-Guard-use-of-mallinfo-with-__GLIBC__.patch \
- file://0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
- file://0005-tweak-MODPROBE_CMD-for-cross-compile.patch \
+ file://0001-implement-libc-specific-reopen_stream.patch \
+ file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
+ file://0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
+ file://0004-tweak-MODPROBE_CMD-for-cross-compile.patch \
+ file://0001-Avoid-bashisms-in-init-scripts.patch \
"
-
S = "${WORKDIR}/LVM2.${PV}"
inherit autotools-brokensep pkgconfig systemd
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
- thin-provisioning-tools \
- odirect \
-"
+# odirect is always enabled because there currently is a bug in
+# lib/device/dev-io.c which prevents compiling without it. It is
+# better to stick to configurations that were actually tested by
+# upstream...
+PACKAGECONFIG_append = " odirect"
+PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
+PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
+PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline"
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
PACKAGECONFIG[thin-provisioning-tools] = "--with-thin=internal,--with-thin=none,,thin-provisioning-tools"
-PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
- --with-group= \
- --enable-realtime \
- --enable-applib \
- --enable-cmdlib \
- --enable-udev_sync \
- --enable-udev_rules \
- --enable-pkgconfig \
- --enable-dmeventd \
- --enable-lvmetad \
- --with-udev-prefix= \
- --with-usrlibdir=${libdir} \
- --with-systemdsystemunitdir=${systemd_system_unitdir} \
- --disable-thin_check_needs_check \
- --with-thin-check=${sbindir}/thin_check \
- --with-thin-dump=${sbindir}/thin_dump \
- --with-thin-repair=${sbindir}/thin_repair \
- --with-thin-restore=${sbindir}/thin_restore \
-"
-
-CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
-
-do_install_append() {
- # Install machine specific configuration file
- install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
- sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
- if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
- oe_runmake 'DESTDIR=${D}' install install_systemd_units
- sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
- else
- oe_runmake 'DESTDIR=${D}' install install_initscripts
- mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
- rm -rf ${D}${sysconfdir}/rc.d
- fi
-}
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "lvm2-monitor.service dm-event.socket dm-event.service lvm2-lvmetad.socket \
- lvm2-pvscan@.service blk-availability.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-FILES_${PN} += "${libdir}/device-mapper/*.so ${base_libdir}/udev"
-FILES_${PN}-dbg += "${libdir}/device-mapper/.debug"
-
-RDEPENDS_${PN} = "bash"
-
-CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
deleted file mode 100644
index f0b4e71da..000000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 089c9c701a1b68b721f479dfc0c58c35b9dd4175 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:39:53 +0000
-Subject: [PATCH 1/4] implement libc specific _reopen_stream
-
-musl defines stdin/stdio/stderr as constant types which means
-we can not assign to them as we are doing here but works ok with glibc
-therefore abstract out the _reopen_stream definition depending upon if
-we are using glibc or otherwise
-
-Origin:
-http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- lib/commands/toolcontext.c | 22 +++++++++++-----------
- tools/lvmcmdline.c | 6 +++---
- 2 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
-index a2f21b8..7f796e4 100644
---- a/lib/commands/toolcontext.c
-+++ b/lib/commands/toolcontext.c
-@@ -1637,7 +1637,10 @@ static void _init_globals(struct cmd_context *cmd)
- /*
- * Close and reopen stream on file descriptor fd.
- */
--static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
-+#ifdef __GLIBC__
-+#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
-+
-+static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
- {
- int fd_copy, new_fd;
-
-@@ -1664,6 +1667,9 @@ static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *na
-
- return 1;
- }
-+#else
-+#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
-+#endif
-
- static int _init_lvmetad(struct cmd_context *cmd)
- {
-@@ -1741,7 +1747,6 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- unsigned set_filters)
- {
- struct cmd_context *cmd;
-- FILE *new_stream;
- int flags;
-
- #ifdef M_MMAP_MAX
-@@ -1791,9 +1796,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- if (is_valid_fd(STDIN_FILENO) &&
- ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- (flags & O_ACCMODE) != O_WRONLY) {
-- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
-+ if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
- goto_out;
-- stdin = new_stream;
- if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
- log_sys_error("setvbuf", "");
- goto out;
-@@ -1803,9 +1807,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- if (is_valid_fd(STDOUT_FILENO) &&
- ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- (flags & O_ACCMODE) != O_RDONLY) {
-- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
-+ if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
- goto_out;
-- stdout = new_stream;
- if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
- _IOLBF, linebuffer_size)) {
- log_sys_error("setvbuf", "");
-@@ -2131,7 +2134,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
- void destroy_toolcontext(struct cmd_context *cmd)
- {
- struct dm_config_tree *cft_cmdline;
-- FILE *new_stream;
- int flags;
-
- if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
-@@ -2167,8 +2169,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- if (is_valid_fd(STDIN_FILENO) &&
- ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- (flags & O_ACCMODE) != O_WRONLY) {
-- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
-- stdin = new_stream;
-+ if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
- setlinebuf(stdin);
- } else
- cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
-@@ -2177,8 +2178,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- if (is_valid_fd(STDOUT_FILENO) &&
- ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- (flags & O_ACCMODE) != O_RDONLY) {
-- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
-- stdout = new_stream;
-+ if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
- setlinebuf(stdout);
- } else
- cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
-diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
-index 6577977..a33258a 100644
---- a/tools/lvmcmdline.c
-+++ b/tools/lvmcmdline.c
-@@ -1744,7 +1744,7 @@ static int _check_standard_fds(void)
- int err = is_valid_fd(STDERR_FILENO);
-
- if (!is_valid_fd(STDIN_FILENO) &&
-- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
-+ !freopen(_PATH_DEVNULL, "r", stdin)) {
- if (err)
- perror("stdin stream open");
- else
-@@ -1754,7 +1754,7 @@ static int _check_standard_fds(void)
- }
-
- if (!is_valid_fd(STDOUT_FILENO) &&
-- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
-+ !freopen(_PATH_DEVNULL, "w", stdout)) {
- if (err)
- perror("stdout stream open");
- /* else no stdout */
-@@ -1762,7 +1762,7 @@ static int _check_standard_fds(void)
- }
-
- if (!is_valid_fd(STDERR_FILENO) &&
-- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
-+ !freopen(_PATH_DEVNULL, "w", stderr)) {
- printf("stderr stream open: %s\n",
- strerror(errno));
- return 0;
---
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
deleted file mode 100644
index 969a15287..000000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c8a1b669cbff3eee367fd4db3389e337bc4c98ba Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:46:26 +0000
-Subject: [PATCH 2/4] use PTHREAD_MUTEX_RECURSIVE instead of
- PTHREAD_MUTEX_RECURSIVE_NP
-
-PTHREAD_MUTEX_RECURSIVE_NP was used for compatibility with old glibc.
-Although due to the_GNU_SOURCES define the portable,
-PTHREAD_MUTEX_RECURSIVE will be available for Linuxes since at least
-1998. Simplify things giving us compatibility with musl which
-apparently does not provide the non-portable define.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- daemons/lvmetad/lvmetad-core.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
-index 7af9bde..63707c2 100644
---- a/daemons/lvmetad/lvmetad-core.c
-+++ b/daemons/lvmetad/lvmetad-core.c
-@@ -300,7 +300,7 @@ static struct dm_config_tree *lock_vg(lvmetad_state *s, const char *id) {
- if (!(vg = dm_hash_lookup(s->lock.vg, id))) {
- if (!(vg = malloc(sizeof(pthread_mutex_t))) ||
- pthread_mutexattr_init(&rec) ||
-- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) ||
-+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) ||
- pthread_mutex_init(vg, &rec))
- goto bad;
- if (!dm_hash_insert(s->lock.vg, id, vg)) {
-@@ -2890,7 +2890,7 @@ static int init(daemon_state *s)
- ls->log = s->log;
-
- pthread_mutexattr_init(&rec);
-- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP);
-+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec);
- pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec);
- pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL);
---
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
deleted file mode 100644
index 13a866ea0..000000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require lvm2.inc
-
-SRC_URI[md5sum] = "c660e02ad4586a1d297b6befbe85556d"
-SRC_URI[sha256sum] = "93878a4ba4f70d9f2d0d919eb85bc51652a58776b5428ec8e7e32769d332f596"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
new file mode 100644
index 000000000..7939f0552
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
@@ -0,0 +1,81 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+ thin-provisioning-tools \
+ udev \
+"
+
+PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+ --with-group= \
+ --enable-realtime \
+ --enable-applib \
+ --enable-cmdlib \
+ --enable-pkgconfig \
+ --with-usrlibdir=${libdir} \
+ --with-systemdsystemunitdir=${systemd_system_unitdir} \
+ --disable-thin_check_needs_check \
+ --with-thin-check=${sbindir}/thin_check \
+ --with-thin-dump=${sbindir}/thin_dump \
+ --with-thin-repair=${sbindir}/thin_repair \
+ --with-thin-restore=${sbindir}/thin_restore \
+"
+
+CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
+
+do_install_append() {
+ # Install machine specific configuration file
+ install -d ${D}${sysconfdir}/lvm
+ install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
+ sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ oe_runmake 'DESTDIR=${D}' install install_systemd_units
+ sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
+ else
+ oe_runmake 'DESTDIR=${D}' install install_initscripts
+ mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
+ rm -rf ${D}${sysconfdir}/rc.d
+ fi
+ # Remove things related to libdevmapper
+ rm -f ${D}${sbindir}/dmsetup
+ rm -f ${D}${libdir}/libdevmapper.so.*
+ rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
+}
+
+PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'lvmetad', 'lvm2-lvmetad.socket lvm2-pvscan@.service', '', d)} \
+ blk-availability.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+FILES_${PN} += "${libdir}/device-mapper/*.so"
+FILES_${PN}-scripts = " \
+ ${sbindir}/blkdeactivate \
+ ${sbindir}/fsadm \
+ ${sbindir}/lvmconf \
+ ${sbindir}/lvmdump \
+"
+# Specified explicitly for the udev rules, just in case that it does not get picked
+# up automatically:
+FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
+RDEPENDS_${PN}_append_class-target = " libdevmapper"
+
+RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash"
+RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
+
+CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+
+BBCLASSEXTEND = "native nativesdk"
OpenPOWER on IntegriCloud