lol

Merge pull request #217602 from helsinki-systems/upd/lvm2

lvm2: 2.03.18 -> 2.03.19

authored by

Florian Klink and committed by
GitHub
19ade08e 3cdd7718

+83 -72
-4
pkgs/os-specific/linux/lvm2/2_02.nix
··· 1 - import ./common.nix { 2 - version = "2.02.188"; 3 - hash = "sha256-cQHosIFq135DkP7ZdJoJAhS6UgBhzQg0N4ceGeUMyb0="; 4 - }
+2 -2
pkgs/os-specific/linux/lvm2/2_03.nix
··· 1 1 import ./common.nix { 2 - version = "2.03.18"; 3 - hash = "sha256-n2g+KYDZXA3Ou9JcfBdwMsVhXXJnv8iF6r/OWSgPR2k="; 2 + version = "2.03.19"; 3 + hash = "sha256-7J/58dmYzisF8a0i3c+UAdIC0CFYEdxGjXjLprCyaHk="; 4 4 }
+12 -27
pkgs/os-specific/linux/lvm2/common.nix
··· 1 1 { version, hash }: 2 2 3 3 { lib, stdenv 4 - , fetchpatch 5 4 , fetchurl 6 5 , pkg-config 7 6 , coreutils ··· 52 51 "--with-default-locking-dir=/run/lock/lvm" 53 52 "--with-default-run-dir=/run/lvm" 54 53 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 54 + "--with-systemd-run=/run/current-system/systemd/bin/systemd-run" 55 55 ] ++ lib.optionals (!enableCmdlib) [ 56 56 "--bindir=${placeholder "bin"}/bin" 57 57 "--sbindir=${placeholder "bin"}/bin" ··· 68 68 ] ++ lib.optionals udevSupport [ 69 69 "--enable-udev_rules" 70 70 "--enable-udev_sync" 71 + ] ++ lib.optionals enableVDO [ 72 + "--enable-vdo" 71 73 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 72 74 "--enable-static_link" 73 - ] ++ lib.optionals enableVDO [ 74 - "--enable-vdo" 75 75 ]; 76 76 77 77 preConfigure = '' 78 78 sed -i /DEFAULT_SYS_DIR/d Makefile.in 79 79 sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in 80 - '' + lib.optionalString (lib.versionOlder version "2.03.15") '' 81 - substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \ 82 - --replace /usr/bin/udevadm /run/current-system/systemd/bin/udevadm 83 - # https://github.com/lvmteam/lvm2/issues/36 84 - '' + lib.optionalString (lib.versionOlder version "2.03.14") '' 85 - substituteInPlace udev/69-dm-lvm-metad.rules.in \ 86 - --replace "(BINDIR)/systemd-run" /run/current-system/systemd/bin/systemd-run 87 - '' + lib.optionalString (lib.versionAtLeast version "2.03.14") '' 88 - substituteInPlace udev/69-dm-lvm.rules.in \ 89 - --replace "/usr/bin/systemd-run" /run/current-system/systemd/bin/systemd-run 90 - '' + '' 80 + 91 81 substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 92 - '' + lib.optionalString (lib.versionAtLeast version "2.03") '' 93 82 substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system" 94 83 95 84 substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \ ··· 100 89 sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h 101 90 ''; 102 91 103 - patches = lib.optionals (lib.versionAtLeast version "2.03.15") [ 92 + patches = [ 104 93 # fixes paths to and checks for tools 105 - # TODO: needs backport to LVM 2.02 used by static/musl 106 94 (substituteAll (let 107 95 optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw"; 108 96 in { ··· 113 101 multipath_tools = optionalTool enableMultipath multipath-tools; 114 102 vdo = optionalTool enableVDO vdo; 115 103 })) 116 - ] ++ lib.optionals (lib.versionOlder version "2.03.15") [ 117 - # Musl fixes from Alpine. 104 + # Musl fix from Alpine 118 105 ./fix-stdio-usage.patch 119 - (fetchpatch { 120 - name = "mallinfo.patch"; 121 - url = "https://git.alpinelinux.org/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50"; 122 - sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0"; 123 - }) 124 106 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 125 - ./no-shared.diff 107 + ./no-shared.patch 126 108 ]; 127 109 128 110 doCheck = false; # requires root 129 111 130 112 makeFlags = lib.optionals udevSupport [ 131 - "SYSTEMD_GENERATOR_DIR=$(out)/lib/systemd/system-generators" 113 + "SYSTEMD_GENERATOR_DIR=${placeholder "out"}/lib/systemd/system-generators" 132 114 ] ++ lib.optionals onlyLib [ 133 115 "libdm.device-mapper" 134 116 ]; ··· 164 146 moveToOutput lib/libdevmapper.so $lib 165 147 ''; 166 148 167 - passthru.tests.installer = nixosTests.installer.lvm; 149 + passthru.tests = { 150 + installer = nixosTests.installer.lvm; 151 + lvm2 = nixosTests.lvm2; 152 + }; 168 153 169 154 meta = with lib; { 170 155 homepage = "http://sourceware.org/lvm2/";
+22 -9
pkgs/os-specific/linux/lvm2/fix-stdio-usage.patch
··· 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 + 1 11 diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c 2 - index 296618686..96343eeb7 100644 12 + index b630554a9..f20080d18 100644 3 13 --- a/lib/commands/toolcontext.c 4 14 +++ b/lib/commands/toolcontext.c 5 - @@ -1619,7 +1619,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd, 15 + @@ -1667,7 +1667,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd, 6 16 /* FIXME Make this configurable? */ 7 17 reset_lvm_errno(1); 8 18 ··· 11 21 /* Set in/out stream buffering before glibc */ 12 22 if (set_buffering 13 23 #ifdef SYS_gettid 14 - @@ -2006,7 +2006,7 @@ void destroy_toolcontext(struct cmd_context *cmd) 24 + @@ -2045,7 +2045,7 @@ void destroy_toolcontext(struct cmd_context *cmd) 25 + dm_hash_destroy(cmd->cft_def_hash); 15 26 16 - if (cmd->pending_delete_mem) 17 - dm_pool_destroy(cmd->pending_delete_mem); 27 + dm_device_list_destroy(&cmd->cache_dm_devs); 18 28 -#ifndef VALGRIND_POOL 19 29 +#if !defined(VALGRIND_POOL) && defined(__GLIBC__) 20 30 if (cmd->linebuffer) { 21 31 /* Reset stream buffering to defaults */ 22 32 if (is_valid_fd(STDIN_FILENO) && 23 33 diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c 24 - index d97ff5720..bbbda82bd 100644 34 + index a5bb6a5c5..0ebfa375c 100644 25 35 --- a/tools/lvmcmdline.c 26 36 +++ b/tools/lvmcmdline.c 27 - @@ -3342,7 +3342,7 @@ static int _check_standard_fds(void) 37 + @@ -3422,7 +3422,7 @@ static int _check_standard_fds(void) 28 38 int err = is_valid_fd(STDERR_FILENO); 29 39 30 40 if (!is_valid_fd(STDIN_FILENO) && ··· 33 43 if (err) 34 44 perror("stdin stream open"); 35 45 else 36 - @@ -3352,7 +3352,7 @@ static int _check_standard_fds(void) 46 + @@ -3432,7 +3432,7 @@ static int _check_standard_fds(void) 37 47 } 38 48 39 49 if (!is_valid_fd(STDOUT_FILENO) && ··· 42 52 if (err) 43 53 perror("stdout stream open"); 44 54 /* else no stdout */ 45 - @@ -3360,7 +3360,7 @@ static int _check_standard_fds(void) 55 + @@ -3440,7 +3440,7 @@ static int _check_standard_fds(void) 46 56 } 47 57 48 58 if (!is_valid_fd(STDERR_FILENO) && ··· 51 61 printf("stderr stream open: %s\n", 52 62 strerror(errno)); 53 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
··· 26265 26265 26266 26266 lsscsi = callPackage ../os-specific/linux/lsscsi { }; 26267 26267 26268 - lvm2-2_03 = callPackage ../os-specific/linux/lvm2/2_03.nix { 26268 + lvm2 = callPackage ../os-specific/linux/lvm2/2_03.nix { 26269 26269 # udev is the same package as systemd which depends on cryptsetup 26270 26270 # which depends on lvm2 again. But we only need the libudev part 26271 26271 # which does not depend on cryptsetup. ··· 26275 26275 # systemd (optionally, but on by default) on cryptsetup and cryptsetup depends on lvm2 26276 26276 util-linux = util-linuxMinimal; 26277 26277 }; 26278 - lvm2-2_02 = callPackage ../os-specific/linux/lvm2/2_02.nix { 26279 - udev = systemdMinimal; 26280 - }; 26281 - lvm2 = if stdenv.hostPlatform.isMusl then lvm2-2_02 else lvm2-2_03; 26282 26278 26283 26279 lvm2_dmeventd = lvm2.override { 26284 26280 enableDmeventd = true;