lvm2-2_02: remove

2.03.x builds with musl again after 2.03.19

ajs124 8d3141af 1d7d07ca

+75 -63
-4
pkgs/os-specific/linux/lvm2/2_02.nix
··· 1 - import ./common.nix { 2 - version = "2.02.188"; 3 - hash = "sha256-cQHosIFq135DkP7ZdJoJAhS6UgBhzQg0N4ceGeUMyb0="; 4 - }
···
+6 -20
pkgs/os-specific/linux/lvm2/common.nix
··· 1 { version, hash }: 2 3 { lib, stdenv 4 - , fetchpatch 5 , fetchurl 6 , pkg-config 7 , coreutils ··· 69 ] ++ lib.optionals udevSupport [ 70 "--enable-udev_rules" 71 "--enable-udev_sync" 72 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 73 "--enable-static_link" 74 - ] ++ lib.optionals enableVDO [ 75 - "--enable-vdo" 76 ]; 77 78 preConfigure = '' ··· 80 sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in 81 82 substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 83 - '' + lib.optionalString (lib.versionOlder version "2.03") '' 84 - substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \ 85 - --replace /usr/bin/udevadm /run/current-system/systemd/bin/udevadm 86 - substituteInPlace udev/69-dm-lvm-metad.rules.in \ 87 - --replace "(BINDIR)/systemd-run" /run/current-system/systemd/bin/systemd-run 88 - '' + lib.optionalString (lib.versionAtLeast version "2.03") '' 89 substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 90 91 substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \ ··· 96 sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h 97 ''; 98 99 - patches = lib.optionals (lib.versionAtLeast version "2.03.15") [ 100 # fixes paths to and checks for tools 101 - # TODO: needs backport to LVM 2.02 used by static/musl 102 (substituteAll (let 103 optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw"; 104 in { ··· 109 multipath_tools = optionalTool enableMultipath multipath-tools; 110 vdo = optionalTool enableVDO vdo; 111 })) 112 - ] ++ lib.optionals (lib.versionOlder version "2.03.15") [ 113 - # Musl fixes from Alpine. 114 ./fix-stdio-usage.patch 115 - (fetchpatch { 116 - name = "mallinfo.patch"; 117 - url = "https://git.alpinelinux.org/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50"; 118 - sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0"; 119 - }) 120 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 121 - ./no-shared.diff 122 ]; 123 124 doCheck = false; # requires root 125 126 makeFlags = lib.optionals udevSupport [ 127 - "SYSTEMD_GENERATOR_DIR=$(out)/lib/systemd/system-generators" 128 ] ++ lib.optionals onlyLib [ 129 "libdm.device-mapper" 130 ];
··· 1 { version, hash }: 2 3 { lib, stdenv 4 , fetchurl 5 , pkg-config 6 , coreutils ··· 68 ] ++ lib.optionals udevSupport [ 69 "--enable-udev_rules" 70 "--enable-udev_sync" 71 + ] ++ lib.optionals enableVDO [ 72 + "--enable-vdo" 73 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 74 "--enable-static_link" 75 ]; 76 77 preConfigure = '' ··· 79 sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in 80 81 substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 82 substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 83 84 substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \ ··· 89 sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h 90 ''; 91 92 + patches = [ 93 # fixes paths to and checks for tools 94 (substituteAll (let 95 optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw"; 96 in { ··· 101 multipath_tools = optionalTool enableMultipath multipath-tools; 102 vdo = optionalTool enableVDO vdo; 103 })) 104 + # Musl fix from Alpine 105 ./fix-stdio-usage.patch 106 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 107 + ./no-shared.patch 108 ]; 109 110 doCheck = false; # requires root 111 112 makeFlags = lib.optionals udevSupport [ 113 + "SYSTEMD_GENERATOR_DIR=${placeholder "out"}/lib/systemd/system-generators" 114 ] ++ lib.optionals onlyLib [ 115 "libdm.device-mapper" 116 ];
+22 -9
pkgs/os-specific/linux/lvm2/fix-stdio-usage.patch
··· 1 diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c 2 - index 296618686..96343eeb7 100644 3 --- a/lib/commands/toolcontext.c 4 +++ b/lib/commands/toolcontext.c 5 - @@ -1619,7 +1619,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd, 6 /* FIXME Make this configurable? */ 7 reset_lvm_errno(1); 8 ··· 11 /* Set in/out stream buffering before glibc */ 12 if (set_buffering 13 #ifdef SYS_gettid 14 - @@ -2006,7 +2006,7 @@ void destroy_toolcontext(struct cmd_context *cmd) 15 16 - if (cmd->pending_delete_mem) 17 - dm_pool_destroy(cmd->pending_delete_mem); 18 -#ifndef VALGRIND_POOL 19 +#if !defined(VALGRIND_POOL) && defined(__GLIBC__) 20 if (cmd->linebuffer) { 21 /* Reset stream buffering to defaults */ 22 if (is_valid_fd(STDIN_FILENO) && 23 diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c 24 - index d97ff5720..bbbda82bd 100644 25 --- a/tools/lvmcmdline.c 26 +++ b/tools/lvmcmdline.c 27 - @@ -3342,7 +3342,7 @@ static int _check_standard_fds(void) 28 int err = is_valid_fd(STDERR_FILENO); 29 30 if (!is_valid_fd(STDIN_FILENO) && ··· 33 if (err) 34 perror("stdin stream open"); 35 else 36 - @@ -3352,7 +3352,7 @@ static int _check_standard_fds(void) 37 } 38 39 if (!is_valid_fd(STDOUT_FILENO) && ··· 42 if (err) 43 perror("stdout stream open"); 44 /* else no stdout */ 45 - @@ -3360,7 +3360,7 @@ static int _check_standard_fds(void) 46 } 47 48 if (!is_valid_fd(STDERR_FILENO) && ··· 51 printf("stderr stream open: %s\n", 52 strerror(errno)); 53 return 0;
··· 1 + From 63b1c7332bee6080bffecf9ce9d75ff15d799166 Mon Sep 17 00:00:00 2001 2 + From: Natanael Copa <ncopa@alpinelinux.org> 3 + Date: Wed, 16 Nov 2022 10:42:39 +0100 4 + Subject: [PATCH] fix stdio usage 5 + 6 + --- 7 + lib/commands/toolcontext.c | 4 ++-- 8 + tools/lvmcmdline.c | 6 +++--- 9 + 2 files changed, 5 insertions(+), 5 deletions(-) 10 + 11 diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c 12 + index b630554a9..f20080d18 100644 13 --- a/lib/commands/toolcontext.c 14 +++ b/lib/commands/toolcontext.c 15 + @@ -1667,7 +1667,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd, 16 /* FIXME Make this configurable? */ 17 reset_lvm_errno(1); 18 ··· 21 /* Set in/out stream buffering before glibc */ 22 if (set_buffering 23 #ifdef SYS_gettid 24 + @@ -2045,7 +2045,7 @@ void destroy_toolcontext(struct cmd_context *cmd) 25 + dm_hash_destroy(cmd->cft_def_hash); 26 27 + dm_device_list_destroy(&cmd->cache_dm_devs); 28 -#ifndef VALGRIND_POOL 29 +#if !defined(VALGRIND_POOL) && defined(__GLIBC__) 30 if (cmd->linebuffer) { 31 /* Reset stream buffering to defaults */ 32 if (is_valid_fd(STDIN_FILENO) && 33 diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c 34 + index a5bb6a5c5..0ebfa375c 100644 35 --- a/tools/lvmcmdline.c 36 +++ b/tools/lvmcmdline.c 37 + @@ -3422,7 +3422,7 @@ static int _check_standard_fds(void) 38 int err = is_valid_fd(STDERR_FILENO); 39 40 if (!is_valid_fd(STDIN_FILENO) && ··· 43 if (err) 44 perror("stdin stream open"); 45 else 46 + @@ -3432,7 +3432,7 @@ static int _check_standard_fds(void) 47 } 48 49 if (!is_valid_fd(STDOUT_FILENO) && ··· 52 if (err) 53 perror("stdout stream open"); 54 /* else no stdout */ 55 + @@ -3440,7 +3440,7 @@ static int _check_standard_fds(void) 56 } 57 58 if (!is_valid_fd(STDERR_FILENO) && ··· 61 printf("stderr stream open: %s\n", 62 strerror(errno)); 63 return 0; 64 + -- 65 + 2.38.1 66 +
-25
pkgs/os-specific/linux/lvm2/no-shared.diff
··· 1 - diff --git a/libdm/Makefile.in b/libdm/Makefile.in 2 - index 66ec39513..ab7123dae 100644 3 - --- a/libdm/Makefile.in 4 - +++ b/libdm/Makefile.in 5 - @@ -44,7 +44,6 @@ endif 6 - 7 - LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX) 8 - LIB_VERSION = $(LIB_VERSION_DM) 9 - -TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) 10 - 11 - CFLOW_LIST = $(SOURCES) 12 - CFLOW_LIST_TARGET = libdevmapper.cflow 13 - diff --git a/make.tmpl.in b/make.tmpl.in 14 - index e7780e8d4..ca4aa9fdd 100644 15 - --- a/make.tmpl.in 16 - +++ b/make.tmpl.in 17 - @@ -346,7 +346,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow) 18 - SUBDIRS.clean := $(SUBDIRS:=.clean) 19 - SUBDIRS.distclean := $(SUBDIRS:=.distclean) 20 - 21 - -TARGETS += $(LIB_SHARED) $(LIB_STATIC) 22 - +TARGETS += $(LIB_STATIC) 23 - 24 - all: $(SUBDIRS) $(TARGETS) 25 -
···
+46
pkgs/os-specific/linux/lvm2/no-shared.patch
···
··· 1 + diff --git a/libdm/Makefile.in b/libdm/Makefile.in 2 + index 2758648e6..f305a12b0 100644 3 + --- a/libdm/Makefile.in 4 + +++ b/libdm/Makefile.in 5 + @@ -47,7 +47,6 @@ endif 6 + 7 + LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX) 8 + LIB_VERSION = $(LIB_VERSION_DM) 9 + -TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) .symver_check 10 + 11 + CFLOW_LIST = $(SOURCES) 12 + CFLOW_LIST_TARGET = libdevmapper.cflow 13 + diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in 14 + index a731687c2..9366cdf1c 100644 15 + --- a/libdm/make.tmpl.in 16 + +++ b/libdm/make.tmpl.in 17 + @@ -314,7 +314,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow) 18 + SUBDIRS.clean := $(SUBDIRS:=.clean) 19 + SUBDIRS.distclean := $(SUBDIRS:=.distclean) 20 + 21 + -TARGETS += $(LIB_SHARED) $(LIB_STATIC) 22 + +TARGETS += $(LIB_STATIC) 23 + 24 + all: $(SUBDIRS) $(TARGETS) 25 + 26 + @@ -431,7 +431,6 @@ DEFS+=-D_FILE_OFFSET_BITS=64 27 + 28 + ifneq (,$(LIB_SHARED)) 29 + 30 + -TARGETS += $(LIB_SHARED).$(LIB_VERSION) 31 + $(LIB_SHARED).$(LIB_VERSION): $(OBJECTS) $(LDDEPS) 32 + @echo " [CC] $@" 33 + ifeq ("@LIB_SUFFIX@","so") 34 + diff --git a/make.tmpl.in b/make.tmpl.in 35 + index b73176f5a..6100d0dfd 100644 36 + --- a/make.tmpl.in 37 + +++ b/make.tmpl.in 38 + @@ -368,7 +368,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow) 39 + SUBDIRS.clean := $(SUBDIRS:=.clean) 40 + SUBDIRS.distclean := $(SUBDIRS:=.distclean) 41 + 42 + -TARGETS += $(LIB_SHARED) $(LIB_STATIC) 43 + +TARGETS += $(LIB_STATIC) 44 + 45 + INTERNAL_LIBS = \ 46 + $(top_builddir)/libdaemon/client/libdaemonclient.a \
+1 -5
pkgs/top-level/all-packages.nix
··· 26245 26246 lsscsi = callPackage ../os-specific/linux/lsscsi { }; 26247 26248 - lvm2-2_03 = callPackage ../os-specific/linux/lvm2/2_03.nix { 26249 # udev is the same package as systemd which depends on cryptsetup 26250 # which depends on lvm2 again. But we only need the libudev part 26251 # which does not depend on cryptsetup. ··· 26255 # systemd (optionally, but on by default) on cryptsetup and cryptsetup depends on lvm2 26256 util-linux = util-linuxMinimal; 26257 }; 26258 - lvm2-2_02 = callPackage ../os-specific/linux/lvm2/2_02.nix { 26259 - udev = systemdMinimal; 26260 - }; 26261 - lvm2 = if stdenv.hostPlatform.isMusl then lvm2-2_02 else lvm2-2_03; 26262 26263 lvm2_dmeventd = lvm2.override { 26264 enableDmeventd = true;
··· 26245 26246 lsscsi = callPackage ../os-specific/linux/lsscsi { }; 26247 26248 + lvm2 = callPackage ../os-specific/linux/lvm2/2_03.nix { 26249 # udev is the same package as systemd which depends on cryptsetup 26250 # which depends on lvm2 again. But we only need the libudev part 26251 # which does not depend on cryptsetup. ··· 26255 # systemd (optionally, but on by default) on cryptsetup and cryptsetup depends on lvm2 26256 util-linux = util-linuxMinimal; 26257 }; 26258 26259 lvm2_dmeventd = lvm2.override { 26260 enableDmeventd = true;