summaryrefslogtreecommitdiff
path: root/system/lvm2
diff options
context:
space:
mode:
Diffstat (limited to 'system/lvm2')
-rw-r--r--system/lvm2/APKBUILD20
-rw-r--r--system/lvm2/dash.patch64
-rw-r--r--system/lvm2/fix-stdio-usage.patch55
-rw-r--r--system/lvm2/mallinfo.patch11
-rw-r--r--system/lvm2/mlockall-default-config.patch13
5 files changed, 44 insertions, 119 deletions
diff --git a/system/lvm2/APKBUILD b/system/lvm2/APKBUILD
index f0cb77a92..626c1da98 100644
--- a/system/lvm2/APKBUILD
+++ b/system/lvm2/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=lvm2
-pkgver=2.03.05
-pkgrel=2
+pkgver=2.03.21
+pkgrel=0
pkgdesc="Logical Volume Manager 2 utilities"
url="https://sourceware.org/lvm2/"
arch="all"
@@ -11,14 +11,12 @@ license="GPL-2.0+ AND LGPL-2.1-only"
# lvm2 will dlopen libs so we need to add explicit depend
depends="lvm2-libs=$pkgver-r$pkgrel util-linux"
depends_dev="linux-headers"
-makedepends_build="coreutils libaio-dev"
+makedepends_build="bash coreutils libaio-dev"
makedepends_host="$depends_dev util-linux-dev"
makedepends="$makedepends_build $makedepends_host"
replaces="device-mapper $pkgname-dmeventd"
source="https://mirrors.kernel.org/sourceware/$pkgname/LVM2.$pkgver.tgz
- dash.patch
fix-stdio-usage.patch
- mallinfo.patch
mlockall-default-config.patch
lvm.initd
lvm.confd
@@ -39,7 +37,7 @@ build () {
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
- ./configure \
+ CFLAGS="-DHAVE_SYS_FILE_H" ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
@@ -60,7 +58,7 @@ build () {
--with-thin-dump=/sbin/thin_dump \
--with-thin-repair=/sbin/thin_repair \
--with-dmeventd-path=/sbin/dmeventd
- make
+ make SHELL=/bin/bash
}
package() {
@@ -88,11 +86,9 @@ udev() {
}
-sha512sums="3b00f53771e99faa6459ae73353bff06ae37c64bd2659586ec25d0bb43bc3ff8ba5f713c68617fd7662a5f6cb65bca1ad0aea554819048d79c1cce20bf67c50a LVM2.2.03.05.tgz
-9dbdda2b5b35777ea22be5eedd585de6594e856bf168416f11d003683dad9cc3d8dae5a14e5ae22f251d20809960173cd2e7ea0889949d5d1c1d1e2d10f81508 dash.patch
-6ea4efad03f8632f2883f33f9d9f8ca295f7d8d2aa1bfbfa7738e7d711727a511758848dde5776b222bd74e6fb60bed8b56a3cd2f74ca448b8d86f50470a42b9 fix-stdio-usage.patch
-9272ec8c5184ef5dc776ead8f74132e072b7563b5119a3a38b712f00d92a1e3878c9b3a54eb2b01dcba038110c686b39d4c17ecd0eb258537e9217d7ed03c408 mallinfo.patch
-d190c40a137b006d7b63298069c93ff08d2804b990e85d44739cd7c48beec9a569903b98f0d940895fc7365723ba886acd7ef0e08f1f65a1a391d1c448ce080e mlockall-default-config.patch
+sha512sums="6024811c3fa92afd2fc13a10d1c3542352aa9a016f40c3ef588bd2f5f3e41245fed4b36c8a87d9f7f8dddc6e13b7253396f5c811f99665df27751676dc7b5bde LVM2.2.03.21.tgz
+40e49bb34a9c07493ab6a9948e3ac1a85e22f069b69ad2a1369cb7d30a6ea6d72a27f380ad8951f55d939834e2f29c9da589ae475322ea41b4dfce72060b9557 fix-stdio-usage.patch
+0f1feeddf35a7208a240b13d87f479eeb5410ccb534ccd62714355b10721c4eff77d725c72a2b5270320bef12828c32d60003f187db990fad3fef37ec08c1dff mlockall-default-config.patch
a853078660fd2fd943538924f56e81dc5793294e26b8f61d93e6188893f15f4a438d33792b341c1865d61e03f4a371b7c7ee0db5f4130ef7cb7aeaeb9290086a lvm.initd
07caf8fa942290f3c953cc2463aaf55bac01d0bcb9351daf3880fa4d0eefb67fe00761c46a7a4da91cd2f8e492a12fed35853a15dc939cd80d19d3303bc3951d lvm.confd
ca06220065525e93347efb7a5746a367cf55cb03574e50eed29bd7c4eae036bdd199b52c42d81811b6e742649e73ab8e66525f663bed66f9d1d82d0efde50332 dmeventd.initd"
diff --git a/system/lvm2/dash.patch b/system/lvm2/dash.patch
deleted file mode 100644
index d2ab014f8..000000000
--- a/system/lvm2/dash.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- LVM2.2.03.05/configure
-+++ LVM2.2.03.05/configure
-@@ -3077,7 +3077,7 @@ if test -z "$CFLAGS"; then :
- fi
- case "$host_os" in
- linux*)
-- CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
-+ CLDFLAGS="${CLDFLAGS:-"$LDFLAGS"} -Wl,--version-script,.export.sym"
- # equivalent to -rdynamic
- ELDFLAGS="-Wl,--export-dynamic"
- # FIXME Generate list and use --dynamic-list=.dlopen.sym
-@@ -3098,7 +3098,7 @@ case "$host_os" in
- ;;
- darwin*)
- CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
-- CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
-+ CLDFLAGS="${CLDFLAGS:-"$LDFLAGS"}"
- ELDFLAGS=
- CLDWHOLEARCHIVE="-all_load"
- CLDNOWHOLEARCHIVE=
-@@ -3111,7 +3111,7 @@ case "$host_os" in
- BLKDEACTIVATE=no
- ;;
- *)
-- CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
-+ CLDFLAGS="${CLDFLAGS:-"$LDFLAGS"}"
- ;;
- esac
-
---- LVM2.2.03.05/tools/Makefile.in
-+++ LVM2.2.03.05/tools/Makefile.in
-@@ -167,7 +167,7 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX)
-
- command-count.h: $(srcdir)/command-lines.in Makefile
- @echo " [GEN] $@"
-- $(Q) set -o pipefail && \
-+ $(Q) \
- ( cat $(top_srcdir)/tools/license.inc && \
- echo "/* Do not edit. This file is generated by the Makefile. */" && \
- echo -n "#define COMMAND_COUNT " && \
-@@ -176,7 +176,7 @@ command-count.h: $(srcdir)/command-lines.in Makefile
-
- cmds.h: $(srcdir)/command-lines.in Makefile
- @echo " [GEN] $@"
-- $(Q) set -o pipefail && \
-+ $(Q) \
- ( cat $(top_srcdir)/tools/license.inc && \
- echo "/* Do not edit. This file is generated by the Makefile. */" && \
- echo "cmd(CMD_NONE, none)" && \
-@@ -186,11 +186,11 @@ cmds.h: $(srcdir)/command-lines.in Makefile
-
- command-lines-input.h: $(srcdir)/command-lines.in Makefile
- @echo " [GEN] $@"
-- $(Q) set -o pipefail && \
-+ $(Q) \
- ( cat $(top_srcdir)/tools/license.inc && \
- echo "/* Do not edit. This file is generated by the Makefile. */" && \
-- echo -en "const char _command_input[] =\n\n\"" && \
-+ printf "const char _command_input[] =\n\n\"" && \
- $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \
-- echo "\\n\";" \
-+ printf "%s\n" "\\n\";" \
- ) > $@
-
diff --git a/system/lvm2/fix-stdio-usage.patch b/system/lvm2/fix-stdio-usage.patch
index 39ba2e1b4..2b3f0a91f 100644
--- a/system/lvm2/fix-stdio-usage.patch
+++ b/system/lvm2/fix-stdio-usage.patch
@@ -1,6 +1,28 @@
---- ./tools/lvmcmdline.c
-+++ ./tools/lvmcmdline.c
-@@ -1252,7 +1252,7 @@
+From 4cf08811e112100a2b10c60047f3c537ad21d674 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 28 Jan 2023 14:22:42 +0100
+Subject: [PATCH] Use `freopen()` on {stdin,stdout,stderr}
+
+* ISO C does not guarantee that the standard streams are modifiable
+ lvalues. Glibc even calls out this behaviour as non-portable:
+ https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -208,7 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+
+ _check_and_replace_standard_log_streams(old_stream, new_stream);
+
++#ifdef __GLIBC__
+ *stream = new_stream;
++#else
++ freopen(NULL, mode, *stream);
++#endif
+ return 1;
+ }
+
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -3422,7 +3422,7 @@ static int _check_standard_fds(void)
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
@@ -9,7 +31,7 @@
if (err)
perror("stdin stream open");
else
-@@ -1262,7 +1262,7 @@
+@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDOUT_FILENO) &&
@@ -18,7 +40,7 @@
if (err)
perror("stdout stream open");
/* else no stdout */
-@@ -1270,7 +1270,7 @@
+@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDERR_FILENO) &&
@@ -27,23 +49,6 @@
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
---- ./lib/commands/toolcontext.c.orig
-+++ ./lib/commands/toolcontext.c
-@@ -1860,7 +1860,7 @@
- /* FIXME Make this configurable? */
- reset_lvm_errno(1);
-
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- /* Set in/out stream buffering before glibc */
- if (set_buffering) {
- /* Allocate 2 buffers */
-@@ -2241,7 +2241,7 @@
- if (cmd->libmem)
- dm_pool_destroy(cmd->libmem);
-
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- if (cmd->linebuffer) {
- /* Reset stream buffering to defaults */
- if (is_valid_fd(STDIN_FILENO) &&
+--
+2.39.2
+
diff --git a/system/lvm2/mallinfo.patch b/system/lvm2/mallinfo.patch
deleted file mode 100644
index 471a6b255..000000000
--- a/system/lvm2/mallinfo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./lib/mm/memlock.c.orig 2015-03-09 11:18:41.560028850 -0100
-+++ ./lib/mm/memlock.c 2015-03-09 11:19:54.504373309 -0100
-@@ -137,7 +137,7 @@
-
- static void _allocate_memory(void)
- {
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- void *stack_mem;
- struct rlimit limit;
- int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
diff --git a/system/lvm2/mlockall-default-config.patch b/system/lvm2/mlockall-default-config.patch
index 1daadeff3..898611ec7 100644
--- a/system/lvm2/mlockall-default-config.patch
+++ b/system/lvm2/mlockall-default-config.patch
@@ -1,15 +1,14 @@
---- ./conf/example.conf.in.orig
-+++ ./conf/example.conf.in
-@@ -1352,7 +1352,7 @@
- # Use the old behavior of mlockall to pin all memory.
+--- ./conf/example.conf.in.old 2021-10-04 09:59:13.191167497 +0000
++++ ./conf/example.conf.in 2021-10-04 09:59:41.718184441 +0000
+@@ -1696,7 +1696,7 @@
# Prior to version 2.02.62, LVM used mlockall() to pin the whole
# process's memory while activating devices.
-- use_mlockall = 0
+ # This configuration option has an automatic default value.
+- # use_mlockall = 0
+ use_mlockall = 1
# Configuration option activation/monitoring.
- # Monitor LVs that are activated.
-diff --git a/lib/config/defaults.h b/lib/config/defaults.h
+ # Monitor LVs that are activated.diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 8ab1fde..57b2443 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h