From a74f4d113cde8ef53cc55d984b2d07404756ba6c Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Thu, 27 Apr 2017 18:31:53 +0200 Subject: [PATCH] lvm2: fix mlock Out of memory errors on musl --- srcpkgs/lvm2/patches/mlockall-default-config.patch | 14 ++++++++++++++ srcpkgs/lvm2/template | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/lvm2/patches/mlockall-default-config.patch diff --git a/srcpkgs/lvm2/patches/mlockall-default-config.patch b/srcpkgs/lvm2/patches/mlockall-default-config.patch new file mode 100644 index 00000000000..d741df2e0e8 --- /dev/null +++ b/srcpkgs/lvm2/patches/mlockall-default-config.patch @@ -0,0 +1,14 @@ +--- ./lib/config/defaults.h.orig 2017-04-27 18:16:05.879936377 +0200 ++++ ./lib/config/defaults.h 2017-04-27 18:16:35.141849047 +0200 +@@ -55,7 +55,11 @@ + #define DEFAULT_LVMLOCKD_LOCK_RETRIES 3 + #define DEFAULT_LVMETAD_UPDATE_WAIT_TIME 10 + #define DEFAULT_PRIORITISE_WRITE_LOCKS 1 ++#ifdef __GLIBC__ + #define DEFAULT_USE_MLOCKALL 0 ++#else ++#define DEFAULT_USE_MLOCKALL 1 ++#endif + #define DEFAULT_METADATA_READ_ONLY 0 + #define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0 + #define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]" diff --git a/srcpkgs/lvm2/template b/srcpkgs/lvm2/template index f2720a629c4..2b5d64dfd38 100644 --- a/srcpkgs/lvm2/template +++ b/srcpkgs/lvm2/template @@ -1,7 +1,7 @@ # Template file for 'lvm2' pkgname=lvm2 version=2.02.170 -revision=1 +revision=2 wrksrc="LVM2.${version}" build_style=gnu-configure configure_args="--disable-selinux --enable-readline --enable-pkgconfig @@ -26,6 +26,11 @@ checksum=9372d2523027a751cf54eafdf8b761ff843969520c32b0c50abfba65e23d0d40 post_install() { sed -i 's,use_lvmetad = 1,use_lvmetad = 0,' ${DESTDIR}/etc/lvm/lvm.conf + case $XBPS_TARGET_MACHINE in + *-musl) + sed -i 's,use_mlockall = 0,use_mlockall = 1,' ${DESTDIR}/etc/lvm/lvm.conf + ;; + esac vsv lvmetad }