push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import ./common.nix {
version = "2.03.35";
hash = "sha256-6/KLNCdTXitavZmRzYObYWIqDb+4yG3w968fadyqg3E=";
}

View File

@@ -0,0 +1,250 @@
{ version, hash }:
{
lib,
stdenv,
fetchurl,
pkg-config,
coreutils,
libuuid,
libaio,
bash,
bashNonInteractive,
replaceVars,
enableCmdlib ? false,
enableDmeventd ? false,
udevSupport ? !stdenv.hostPlatform.isStatic,
udev,
udevCheckHook,
onlyLib ? stdenv.hostPlatform.isStatic,
# Otherwise we have a infinity recursion during static compilation
enableUtilLinux ? !stdenv.hostPlatform.isStatic,
util-linux,
enableVDO ? false,
vdo,
enableMdadm ? false,
mdadm,
enableMultipath ? false,
multipath-tools,
nixosTests,
buildFHSEnv,
recurseIntoAttrs,
}:
# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well
assert enableDmeventd -> enableCmdlib;
stdenv.mkDerivation rec {
pname =
"lvm2"
+ lib.optionalString enableDmeventd "-with-dmeventd"
+ lib.optionalString enableVDO "-with-vdo";
inherit version;
__structuredAttrs = true;
src = fetchurl {
urls = [
"https://mirrors.kernel.org/sourceware/lvm2/LVM2.${version}.tgz"
"ftp://sourceware.org/pub/lvm2/LVM2.${version}.tgz"
];
inherit hash;
};
strictDeps = true;
nativeBuildInputs = [ pkg-config ] ++ lib.optionals udevSupport [ udevCheckHook ];
buildInputs = [
libaio
bash
]
++ lib.optionals udevSupport [
udev
]
++ lib.optionals (!onlyLib) [
libuuid
]
++ lib.optionals enableVDO [
vdo
];
configureFlags = [
"--disable-readline"
"--enable-pkgconfig"
"--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"
"--with-default-profile-subdir=profile.d"
]
++ lib.optionals (!onlyLib) (
if enableCmdlib then
[
"--bindir=${placeholder "out"}/bin"
"--sbindir=${placeholder "out"}/bin"
]
else
[
"--bindir=${placeholder "bin"}/bin"
"--sbindir=${placeholder "bin"}/bin"
"--libdir=${placeholder "lib"}/lib"
"--with-libexecdir=${placeholder "lib"}/libexec"
]
)
++ lib.optional enableCmdlib "--enable-cmdlib"
++ lib.optionals enableDmeventd [
"--enable-dmeventd"
"--with-dmeventd-pidfile=/run/dmeventd/pid"
"--with-default-dm-run-dir=/run/dmeventd"
]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"ac_cv_func_malloc_0_nonnull=yes"
"ac_cv_func_realloc_0_nonnull=yes"
]
++ lib.optionals udevSupport [
"--enable-udev_rules"
"--enable-udev_sync"
]
++ lib.optionals enableVDO [
"--enable-vdo"
"--with-vdo-format=${vdo}/bin/vdoformat"
]
++ 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 \
--replace '/usr/bin/true' '${coreutils}/bin/true'
'';
postConfigure = ''
sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h
'';
patches = [
# fixes paths to and checks for tools
(replaceVars ./fix-blkdeactivate.patch (
let
optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw";
in
{
inherit coreutils;
util_linux = optionalTool enableUtilLinux util-linux;
mdadm = optionalTool enableMdadm mdadm;
multipath_tools = optionalTool enableMultipath multipath-tools;
vdo = optionalTool enableVDO vdo;
SBINDIR = null; # part of original source code in the patch's context
}
))
./fix-stdio-usage.patch
# https://gitlab.com/lvmteam/lvm2/-/merge_requests/33
./fix-manpage-reproducibility.patch
];
doCheck = false; # requires root
doInstallCheck = true;
makeFlags =
lib.optionals udevSupport [
"SYSTEMD_GENERATOR_DIR=${placeholder "out"}/lib/systemd/system-generators"
]
++ lib.optionals onlyLib [
"libdm.device-mapper"
];
enableParallelBuilding = true;
# To prevent make install from failing.
installFlags = [
"OWNER="
"GROUP="
"confdir=$(out)/etc"
];
# Install systemd stuff.
installTargets = [
"install"
]
++ lib.optionals udevSupport [
"install_systemd_generators"
"install_systemd_units"
"install_tmpfiles_configuration"
];
installPhase = lib.optionalString onlyLib ''
make -C libdm install_${if stdenv.hostPlatform.isStatic then "static" else "dynamic"}
make -C libdm install_include
make -C libdm install_pkgconfig
'';
# only split bin and lib out from out if cmdlib isn't enabled
outputs = [
"out"
]
++ lib.optionals (!onlyLib) [
"dev"
"man"
"scripts"
]
++ lib.optionals (!onlyLib && !enableCmdlib) [
"bin"
"lib"
];
postInstall =
lib.optionalString (!onlyLib) ''
moveToOutput bin/fsadm $scripts
moveToOutput bin/blkdeactivate $scripts
moveToOutput bin/lvmdump $scripts
moveToOutput bin/lvm_import_vdo $scripts
moveToOutput bin/lvmpersist $scripts
moveToOutput libexec/lvresize_fs_helper $scripts/lib
''
+ lib.optionalString (!enableCmdlib) ''
moveToOutput lib/libdevmapper.so $lib
'';
outputChecks = lib.optionalAttrs (!stdenv.hostPlatform.isStatic && !enableVDO) {
out.disallowedRequisites = [
bash
bashNonInteractive
];
lib.disallowedRequisites = [
bash
bashNonInteractive
];
};
passthru.tests = {
installer = nixosTests.installer.lvm;
lvm2 = recurseIntoAttrs nixosTests.lvm2;
# https://github.com/NixOS/nixpkgs/issues/369732
lvm2-fhs-env = buildFHSEnv {
name = "lvm2-fhs-env-test";
targetPkgs = p: [ p.lvm2 ];
};
};
meta = with lib; {
homepage = "http://sourceware.org/lvm2/";
description = "Tools to support Logical Volume Management (LVM) on Linux";
platforms = platforms.linux;
license = with licenses; [
gpl2Only
bsd2
lgpl21
];
maintainers = with maintainers; [
raskin
ajs124
];
};
}

View File

@@ -0,0 +1,51 @@
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index 7c517b87b..e51a33778 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -34,11 +34,11 @@ TOOL=blkdeactivate
DEV_DIR="/dev"
SYS_BLK_DIR="/sys/block"
-MDADM="/sbin/mdadm"
-MOUNTPOINT="/bin/mountpoint"
-MPATHD="/sbin/multipathd"
-UMOUNT="/bin/umount"
-VDO="/bin/vdo"
+MDADM="@mdadm@/bin/mdadm"
+MOUNTPOINT="@util_linux@/bin/mountpoint"
+MPATHD="@multipath_tools@/bin/multipathd"
+UMOUNT="@util_linux@/bin/umount"
+VDO="@vdo@/bin/vdo"
sbindir="@SBINDIR@"
DMSETUP="$sbindir/dmsetup"
@@ -48,7 +48,7 @@ if "$UMOUNT" --help | grep -- "--all-targets" >"$DEV_DIR/null"; then
UMOUNT_OPTS="--all-targets "
else
UMOUNT_OPTS=""
- FINDMNT="/bin/findmnt -r --noheadings -u -o TARGET"
+ FINDMNT="@util_linux@/bin/findmnt -r --noheadings -u -o TARGET"
FINDMNT_READ="read -r mnt"
fi
DMSETUP_OPTS=""
@@ -57,10 +57,10 @@ MDADM_OPTS=""
MPATHD_OPTS=""
VDO_OPTS=""
-LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
+LSBLK="@util_linux@/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
LSBLK_VARS="local devtype local kname local name local mnt"
LSBLK_READ="read -r devtype kname name mnt"
-SORT_MNT="/bin/sort -r -u -k 4"
+SORT_MNT="@coreutils@/bin/sort -r -u -k 4"
# Do not show tool errors by default (only done/skipping summary
# message provided by this script) and no verbose mode by default.
@@ -102,6 +102,7 @@ declare -A SKIP_VG_LIST=()
# (list is an associative array!)
#
declare -A SKIP_UMOUNT_LIST=(["/"]=1 \
+ ["/nix"]=1 ["/nix/store"]=1 \
["/lib"]=1 ["/lib64"]=1 \
["/bin"]=1 ["/sbin"]=1 \
["/var"]=1 ["/var/log"]=1 \

View File

@@ -0,0 +1,31 @@
commit 950f219ed287358df8c128f7e22989177a8de47c
Author: Arnout Engelen <arnout@bzzt.net>
Date: Mon Aug 25 15:55:44 2025 +0200
man: simplify vmautoactivation(7)
Previously this was hard-coded to: "Autoactivation commands use a number
of temp files in /run/lvm (with the expectation that /run is cleared
between boots.)"
Since c1bfc8737f08bf7558b2d788e9756f895cd9eaaa it was made more generic,
but on some systems this logic leads to "Autoactivation commands use a
number of temp files in /run/lvm (with the expectation that /var/run
is cleared between boots)." which I'd say adds more confusion than it
solves.
diff --git a/man/lvmautoactivation.7_main b/man/lvmautoactivation.7_main
index e55943b29..9d429055c 100644
--- a/man/lvmautoactivation.7_main
+++ b/man/lvmautoactivation.7_main
@@ -175,9 +175,7 @@ is reserved for udev output.)
.
Autoactivation commands use a number of temp files in
.I #DEFAULT_RUN_DIR#
-(with the expectation that
-.I #DEFAULT_PID_DIR#
-is cleared between boots).
+(with the expectation that it is cleared between boots).
.
.TP
.B pvs_online

View File

@@ -0,0 +1,68 @@
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 56dc1f856..011ec2700 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1660,6 +1660,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
/* FIXME Make this configurable? */
reset_lvm_errno(1);
+#ifdef __GLIBC__
/* Set in/out stream buffering before glibc */
if (set_buffering
&& !cmd->running_on_valgrind /* Skipping within valgrind execution. */
@@ -1704,7 +1705,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
} else if (!set_buffering)
/* Without buffering, must not use stdin/stdout */
init_silent(1);
-
+#endif
/*
* Environment variable LVM_SYSTEM_DIR overrides this below.
*/
@@ -2038,6 +2039,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
if (cmd->cft_def_hash)
dm_hash_destroy(cmd->cft_def_hash);
+#ifdef __GLIBC__
if (!cmd->running_on_valgrind && cmd->linebuffer) {
int flags;
/* Reset stream buffering to defaults */
@@ -2061,6 +2063,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
free(cmd->linebuffer);
}
+#endif
destroy_config_context(cmd);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 1b2f7f47c..e0674d42d 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3378,7 +3378,7 @@ static int _check_standard_fds(void)
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
+ !freopen(_PATH_DEVNULL, "r", stdin)) {
if (err)
perror("stdin stream open");
else
@@ -3388,7 +3388,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDOUT_FILENO) &&
- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
+ !freopen(_PATH_DEVNULL, "w", stdout)) {
if (err)
perror("stdout stream open");
/* else no stdout */
@@ -3396,7 +3396,7 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDERR_FILENO) &&
- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
+ !freopen(_PATH_DEVNULL, "w", stderr)) {
printf("stderr stream open: %s\n",
strerror(errno));
return 0;