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,69 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
lvm2,
}:
stdenv.mkDerivation rec {
pname = "dmraid";
version = "1.0.0.rc16";
src = fetchurl {
url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/dmraid-${version}.tar.bz2";
sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
};
patches = [
./hardening-format.patch
./fix-dmevent_tool.patch
# Fix build with gcc15, based on
# https://gitlab.alpinelinux.org/alpine/aports/-/raw/dc5b3135517ede55f5e3530e538ca75048d26565/main/dmraid/008-gcc15.patch
./dmraid-fix-build-with-gcc15.patch
]
++ lib.optionals stdenv.hostPlatform.isMusl [
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch";
sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w";
stripLen = 2;
extraPrefix = "1.0.0.rc16/";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch";
sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k";
stripLen = 2;
extraPrefix = "1.0.0.rc16/";
})
];
postPatch = ''
sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
''
+ lib.optionalString stdenv.hostPlatform.isMusl ''
NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE"
'';
preConfigure = "cd */";
buildInputs = [ lvm2 ];
# Hand-written Makefile does not have full dependencies to survive
# parallel build:
# tools/dmraid.c:12:10: fatal error: dmraid/dmraid.h: No such file
enableParallelBuilding = false;
meta = {
description = "Old-style RAID configuration utility";
longDescription = ''
Old RAID configuration utility (still under development, though).
It is fully compatible with modern kernels and mdadm recognizes
its volumes. May be needed for rescuing an older system or nuking
the metadata when reformatting.
'';
maintainers = [ lib.maintainers.raskin ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,33 @@
diff --git a/1.0.0.rc16/lib/activate/activate.c b/1.0.0.rc16/lib/activate/activate.c
index 1d71ea8c0a..0a4ec6afa1 100644
--- a/1.0.0.rc16/lib/activate/activate.c
+++ b/1.0.0.rc16/lib/activate/activate.c
@@ -866,7 +866,7 @@
#define LIB_NAME_LENGTH 255
static int
-do_device(struct lib_context *lc, struct raid_set *rs, int (*f) ())
+do_device(struct lib_context *lc, struct raid_set *rs, int (*f)(char *, char *))
{
int ret = 0;
char lib_name[LIB_NAME_LENGTH];
diff --git a/1.0.0.rc16/lib/misc/file.c b/1.0.0.rc16/lib/misc/file.c
index fe74d5c9c2..c060b6e712 100644
--- a/1.0.0.rc16/lib/misc/file.c
+++ b/1.0.0.rc16/lib/misc/file.c
@@ -59,12 +59,12 @@
int fd, ret = 0;
loff_t o;
struct {
- ssize_t(*func) ();
+ ssize_t(*func)(int, void *, size_t);
const char *what;
} rw_spec[] = {
{
read, "read"}, {
- write, "writ"},}, *rw = rw_spec + ((flags & O_WRONLY) ? 1 : 0);
+ (ssize_t(*)(int, void *, size_t))write, "writ"},}, *rw = rw_spec + ((flags & O_WRONLY) ? 1 : 0);
if ((fd = open(path, flags, lc->mode)) == -1)
LOG_ERR(lc, 0, "opening \"%s\"", path);

View File

@@ -0,0 +1,20 @@
--- a/1.0.0.rc16/tools/dmevent_tool.c.old 2024-12-26 18:39:04.294039876 -0700
+++ a/1.0.0.rc16/tools/dmevent_tool.c 2024-12-26 18:45:59.416784807 -0700
@@ -123,7 +123,7 @@
}
/* Increment option counters. */
-static _process_opt(int opt, const char *cmd)
+static int _process_opt(int opt, const char *cmd)
{
struct opt_def_struct {
const char opt; /* Option character. */
@@ -148,7 +148,7 @@
optc[o->type]++;
optc[OPT_SUM]++;
- return;
+ return 0;
}
}

View File

@@ -0,0 +1,18 @@
--- a/1.0.0.rc16/lib/events/libdmraid-events-isw.c 2016-01-29 05:16:57.455425454 +0000
+++ b/1.0.0.rc16/lib/events/libdmraid-events-isw.c 2016-01-29 05:17:55.520564013 +0000
@@ -838,13 +838,13 @@
sz = _log_all_devs(log_type, rs, NULL, 0);
if (!sz) {
- syslog(LOG_ERR, msg[0]);
+ syslog(LOG_ERR, "%s", msg[0]);
return;
}
str = dm_malloc(++sz);
if (!str) {
- syslog(LOG_ERR, msg[1]);
+ syslog(LOG_ERR, "%s", msg[1]);
return;
}