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

lvm2: 2.03.18 -> 2.03.19

Changed files
+83 -72
pkgs
-4
pkgs/os-specific/linux/lvm2/2_02.nix
···
-
import ./common.nix {
-
version = "2.02.188";
-
hash = "sha256-cQHosIFq135DkP7ZdJoJAhS6UgBhzQg0N4ceGeUMyb0=";
-
}
···
+2 -2
pkgs/os-specific/linux/lvm2/2_03.nix
···
import ./common.nix {
-
version = "2.03.18";
-
hash = "sha256-n2g+KYDZXA3Ou9JcfBdwMsVhXXJnv8iF6r/OWSgPR2k=";
}
···
import ./common.nix {
+
version = "2.03.19";
+
hash = "sha256-7J/58dmYzisF8a0i3c+UAdIC0CFYEdxGjXjLprCyaHk=";
}
+12 -27
pkgs/os-specific/linux/lvm2/common.nix
···
{ version, hash }:
{ lib, stdenv
-
, fetchpatch
, fetchurl
, pkg-config
, coreutils
···
"--with-default-locking-dir=/run/lock/lvm"
"--with-default-run-dir=/run/lvm"
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
] ++ lib.optionals (!enableCmdlib) [
"--bindir=${placeholder "bin"}/bin"
"--sbindir=${placeholder "bin"}/bin"
···
] ++ lib.optionals udevSupport [
"--enable-udev_rules"
"--enable-udev_sync"
] ++ lib.optionals stdenv.hostPlatform.isStatic [
"--enable-static_link"
-
] ++ lib.optionals enableVDO [
-
"--enable-vdo"
];
preConfigure = ''
sed -i /DEFAULT_SYS_DIR/d Makefile.in
sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
-
'' + lib.optionalString (lib.versionOlder version "2.03.15") ''
-
substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
-
--replace /usr/bin/udevadm /run/current-system/systemd/bin/udevadm
-
# https://github.com/lvmteam/lvm2/issues/36
-
'' + lib.optionalString (lib.versionOlder version "2.03.14") ''
-
substituteInPlace udev/69-dm-lvm-metad.rules.in \
-
--replace "(BINDIR)/systemd-run" /run/current-system/systemd/bin/systemd-run
-
'' + lib.optionalString (lib.versionAtLeast version "2.03.14") ''
-
substituteInPlace udev/69-dm-lvm.rules.in \
-
--replace "/usr/bin/systemd-run" /run/current-system/systemd/bin/systemd-run
-
'' + ''
substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
-
'' + lib.optionalString (lib.versionAtLeast version "2.03") ''
substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \
···
sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h
'';
-
patches = lib.optionals (lib.versionAtLeast version "2.03.15") [
# fixes paths to and checks for tools
-
# TODO: needs backport to LVM 2.02 used by static/musl
(substituteAll (let
optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw";
in {
···
multipath_tools = optionalTool enableMultipath multipath-tools;
vdo = optionalTool enableVDO vdo;
}))
-
] ++ lib.optionals (lib.versionOlder version "2.03.15") [
-
# Musl fixes from Alpine.
./fix-stdio-usage.patch
-
(fetchpatch {
-
name = "mallinfo.patch";
-
url = "https://git.alpinelinux.org/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50";
-
sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0";
-
})
] ++ lib.optionals stdenv.hostPlatform.isStatic [
-
./no-shared.diff
];
doCheck = false; # requires root
makeFlags = lib.optionals udevSupport [
-
"SYSTEMD_GENERATOR_DIR=$(out)/lib/systemd/system-generators"
] ++ lib.optionals onlyLib [
"libdm.device-mapper"
];
···
moveToOutput lib/libdevmapper.so $lib
'';
-
passthru.tests.installer = nixosTests.installer.lvm;
meta = with lib; {
homepage = "http://sourceware.org/lvm2/";
···
{ version, hash }:
{ lib, stdenv
, fetchurl
, pkg-config
, coreutils
···
"--with-default-locking-dir=/run/lock/lvm"
"--with-default-run-dir=/run/lvm"
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
+
"--with-systemd-run=/run/current-system/systemd/bin/systemd-run"
] ++ lib.optionals (!enableCmdlib) [
"--bindir=${placeholder "bin"}/bin"
"--sbindir=${placeholder "bin"}/bin"
···
] ++ lib.optionals udevSupport [
"--enable-udev_rules"
"--enable-udev_sync"
+
] ++ lib.optionals enableVDO [
+
"--enable-vdo"
] ++ lib.optionals stdenv.hostPlatform.isStatic [
"--enable-static_link"
];
preConfigure = ''
sed -i /DEFAULT_SYS_DIR/d Makefile.in
sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
+
substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \
···
sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h
'';
+
patches = [
# fixes paths to and checks for tools
(substituteAll (let
optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw";
in {
···
multipath_tools = optionalTool enableMultipath multipath-tools;
vdo = optionalTool enableVDO vdo;
}))
+
# Musl fix from Alpine
./fix-stdio-usage.patch
] ++ lib.optionals stdenv.hostPlatform.isStatic [
+
./no-shared.patch
];
doCheck = false; # requires root
makeFlags = lib.optionals udevSupport [
+
"SYSTEMD_GENERATOR_DIR=${placeholder "out"}/lib/systemd/system-generators"
] ++ lib.optionals onlyLib [
"libdm.device-mapper"
];
···
moveToOutput lib/libdevmapper.so $lib
'';
+
passthru.tests = {
+
installer = nixosTests.installer.lvm;
+
lvm2 = nixosTests.lvm2;
+
};
meta = with lib; {
homepage = "http://sourceware.org/lvm2/";
+22 -9
pkgs/os-specific/linux/lvm2/fix-stdio-usage.patch
···
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
-
index 296618686..96343eeb7 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
-
@@ -1619,7 +1619,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
/* FIXME Make this configurable? */
reset_lvm_errno(1);
···
/* Set in/out stream buffering before glibc */
if (set_buffering
#ifdef SYS_gettid
-
@@ -2006,7 +2006,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
-
if (cmd->pending_delete_mem)
-
dm_pool_destroy(cmd->pending_delete_mem);
-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
if (cmd->linebuffer) {
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO) &&
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
-
index d97ff5720..bbbda82bd 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
-
@@ -3342,7 +3342,7 @@ static int _check_standard_fds(void)
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
···
if (err)
perror("stdin stream open");
else
-
@@ -3352,7 +3352,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDOUT_FILENO) &&
···
if (err)
perror("stdout stream open");
/* else no stdout */
-
@@ -3360,7 +3360,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDERR_FILENO) &&
···
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
···
+
From 63b1c7332bee6080bffecf9ce9d75ff15d799166 Mon Sep 17 00:00:00 2001
+
From: Natanael Copa <ncopa@alpinelinux.org>
+
Date: Wed, 16 Nov 2022 10:42:39 +0100
+
Subject: [PATCH] fix stdio usage
+
+
---
+
lib/commands/toolcontext.c | 4 ++--
+
tools/lvmcmdline.c | 6 +++---
+
2 files changed, 5 insertions(+), 5 deletions(-)
+
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
+
index b630554a9..f20080d18 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
+
@@ -1667,7 +1667,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
/* FIXME Make this configurable? */
reset_lvm_errno(1);
···
/* Set in/out stream buffering before glibc */
if (set_buffering
#ifdef SYS_gettid
+
@@ -2045,7 +2045,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
+
dm_hash_destroy(cmd->cft_def_hash);
+
dm_device_list_destroy(&cmd->cache_dm_devs);
-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
if (cmd->linebuffer) {
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO) &&
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+
index a5bb6a5c5..0ebfa375c 100644
--- 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) &&
···
if (err)
perror("stdin stream open");
else
+
@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDOUT_FILENO) &&
···
if (err)
perror("stdout stream open");
/* else no stdout */
+
@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDERR_FILENO) &&
···
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
+
--
+
2.38.1
+
-25
pkgs/os-specific/linux/lvm2/no-shared.diff
···
-
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
-
index 66ec39513..ab7123dae 100644
-
--- a/libdm/Makefile.in
-
+++ b/libdm/Makefile.in
-
@@ -44,7 +44,6 @@ endif
-
-
LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
-
LIB_VERSION = $(LIB_VERSION_DM)
-
-TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
-
-
CFLOW_LIST = $(SOURCES)
-
CFLOW_LIST_TARGET = libdevmapper.cflow
-
diff --git a/make.tmpl.in b/make.tmpl.in
-
index e7780e8d4..ca4aa9fdd 100644
-
--- a/make.tmpl.in
-
+++ b/make.tmpl.in
-
@@ -346,7 +346,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow)
-
SUBDIRS.clean := $(SUBDIRS:=.clean)
-
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
-
-
-TARGETS += $(LIB_SHARED) $(LIB_STATIC)
-
+TARGETS += $(LIB_STATIC)
-
-
all: $(SUBDIRS) $(TARGETS)
-
···
+46
pkgs/os-specific/linux/lvm2/no-shared.patch
···
···
+
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
+
index 2758648e6..f305a12b0 100644
+
--- a/libdm/Makefile.in
+
+++ b/libdm/Makefile.in
+
@@ -47,7 +47,6 @@ endif
+
+
LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
+
LIB_VERSION = $(LIB_VERSION_DM)
+
-TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) .symver_check
+
+
CFLOW_LIST = $(SOURCES)
+
CFLOW_LIST_TARGET = libdevmapper.cflow
+
diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in
+
index a731687c2..9366cdf1c 100644
+
--- a/libdm/make.tmpl.in
+
+++ b/libdm/make.tmpl.in
+
@@ -314,7 +314,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow)
+
SUBDIRS.clean := $(SUBDIRS:=.clean)
+
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
+
+
-TARGETS += $(LIB_SHARED) $(LIB_STATIC)
+
+TARGETS += $(LIB_STATIC)
+
+
all: $(SUBDIRS) $(TARGETS)
+
+
@@ -431,7 +431,6 @@ DEFS+=-D_FILE_OFFSET_BITS=64
+
+
ifneq (,$(LIB_SHARED))
+
+
-TARGETS += $(LIB_SHARED).$(LIB_VERSION)
+
$(LIB_SHARED).$(LIB_VERSION): $(OBJECTS) $(LDDEPS)
+
@echo " [CC] $@"
+
ifeq ("@LIB_SUFFIX@","so")
+
diff --git a/make.tmpl.in b/make.tmpl.in
+
index b73176f5a..6100d0dfd 100644
+
--- a/make.tmpl.in
+
+++ b/make.tmpl.in
+
@@ -368,7 +368,7 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow)
+
SUBDIRS.clean := $(SUBDIRS:=.clean)
+
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
+
+
-TARGETS += $(LIB_SHARED) $(LIB_STATIC)
+
+TARGETS += $(LIB_STATIC)
+
+
INTERNAL_LIBS = \
+
$(top_builddir)/libdaemon/client/libdaemonclient.a \
+1 -5
pkgs/top-level/all-packages.nix
···
lsscsi = callPackage ../os-specific/linux/lsscsi { };
-
lvm2-2_03 = callPackage ../os-specific/linux/lvm2/2_03.nix {
# udev is the same package as systemd which depends on cryptsetup
# which depends on lvm2 again. But we only need the libudev part
# which does not depend on cryptsetup.
···
# systemd (optionally, but on by default) on cryptsetup and cryptsetup depends on lvm2
util-linux = util-linuxMinimal;
};
-
lvm2-2_02 = callPackage ../os-specific/linux/lvm2/2_02.nix {
-
udev = systemdMinimal;
-
};
-
lvm2 = if stdenv.hostPlatform.isMusl then lvm2-2_02 else lvm2-2_03;
lvm2_dmeventd = lvm2.override {
enableDmeventd = true;
···
lsscsi = callPackage ../os-specific/linux/lsscsi { };
+
lvm2 = callPackage ../os-specific/linux/lvm2/2_03.nix {
# udev is the same package as systemd which depends on cryptsetup
# which depends on lvm2 again. But we only need the libudev part
# which does not depend on cryptsetup.
···
# systemd (optionally, but on by default) on cryptsetup and cryptsetup depends on lvm2
util-linux = util-linuxMinimal;
};
lvm2_dmeventd = lvm2.override {
enableDmeventd = true;