include $(TOPDIR)/rules.mk
PKG_NAME:=LVM2
-PKG_VERSION:=2.03.41
-PKG_VERSION_DM:=1.02.215
+PKG_VERSION:=2.03.42
+PKG_VERSION_DM:=1.02.216
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2 \
https://www.mirrorservice.org/sites/sourceware.org/pub/lvm2
-PKG_HASH:=d58011b845df8ec13816ca13ea6c39d4cb3d038cd2d7d387acdf5681ad7d6637
+PKG_HASH:=352703ef5b72ebb22d4f250284a29b89fe64d4049c6bf64c693f9af486c8081e
PKG_BUILD_DIR:=$(BUILD_DIR)/lvm2-$(BUILD_VARIANT)/$(PKG_NAME).$(PKG_VERSION)
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Sat, 25 Apr 2015 23:34:05 +0200
+Subject: [PATCH] const-stdio: guard glibc-specific stream buffering behind
+ __GLIBC__
+
+create_toolcontext()/destroy_toolcontext() tune glibc's stdio stream
+buffering directly via glibc-only internals; _check_standard_fds() has
+a musl-compatible fallback path already available. Wrap the
+glibc-specific code in #ifdef __GLIBC__ so this builds against musl.
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ lib/commands/toolcontext.c | 4 ++++
+ tools/lvmcmdline.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
-@@ -1665,6 +1665,7 @@ struct cmd_context *create_toolcontext(c
+@@ -1666,6 +1666,7 @@ struct cmd_context *create_toolcontext(c
/* FIXME Make this configurable? */
reset_lvm_errno(1);
/* Set in/out stream buffering before glibc */
if (set_buffering
&& !cmd->running_on_valgrind /* Skipping within valgrind execution. */
-@@ -1709,6 +1710,7 @@ struct cmd_context *create_toolcontext(c
+@@ -1710,6 +1711,7 @@ struct cmd_context *create_toolcontext(c
} else if (!set_buffering)
/* Without buffering, must not use stdin/stdout */
init_silent(1);
/*
* Environment variable LVM_SYSTEM_DIR overrides this below.
-@@ -2047,6 +2049,7 @@ void destroy_toolcontext(struct cmd_cont
+@@ -2048,6 +2050,7 @@ void destroy_toolcontext(struct cmd_cont
if (cmd->cft_def_hash)
dm_hash_destroy(cmd->cft_def_hash);
if (!cmd->running_on_valgrind && cmd->linebuffer) {
int flags;
/* Reset stream buffering to defaults */
-@@ -2070,6 +2073,7 @@ void destroy_toolcontext(struct cmd_cont
+@@ -2071,6 +2074,7 @@ void destroy_toolcontext(struct cmd_cont
free(cmd->linebuffer);
}
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Sat, 25 Apr 2015 23:34:05 +0200
+Subject: [PATCH] no-mallinfo: guard glibc mallinfo()/mlockall policy behind
+ __GLIBC__
+
+_allocate_memory()'s heap-growth probing uses glibc's MALLINFO/mallinfo(),
+which musl doesn't provide; guard it behind #ifdef __GLIBC__ and always
+grow by the full alloc_size on musl instead. Likewise _lock_mem() reads
+activation/use_mlockall from lvm.conf on glibc but always uses mlockall
+unconditionally on musl, where the glibc-specific heuristic this option
+tunes doesn't apply.
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ lib/mm/memlock.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -209,12 +209,15 @@ static void _allocate_memory(void)
if (area == MAX_AREAS && missing > 0) {
/* Too bad. Warn the user and proceed, as things are
-@@ -560,8 +566,13 @@ static void _lock_mem(struct cmd_context
+@@ -565,8 +571,13 @@ static void _lock_mem(struct cmd_context
* will not block memory locked thread
* Note: assuming _memlock_count_daemon is updated before _memlock_count
*/