Merge #301081: mdadm: Fix hardcoded directory

This commit is contained in:
Vladimír Čunát 2024-04-03 07:15:07 +02:00
commit 8e9118f7b7
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
2 changed files with 18 additions and 2 deletions

View file

@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-QWcnrh8QgOpuMJDOo23QdoJvw2kVHjarc2VXupIZb58=";
};
patches = [ ./no-self-references.patch ];
patches = [
./no-self-references.patch
./fix-hardcoded-mapdir.patch
];
makeFlags = [
"NIXOS=1" "INSTALL=install" "BINDIR=$(out)/sbin"
@ -46,7 +49,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Programs for managing RAID arrays under Linux";
homepage = "http://neil.brown.name/blog/mdadm";
homepage = "https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git";
license = licenses.gpl2;
mainProgram = "mdadm";
maintainers = with maintainers; [ ekleog ];

View file

@ -0,0 +1,13 @@
diff --git a/udev.c b/udev.c
index bc4722b0..aa2a1a24 100644
--- a/udev.c
+++ b/udev.c
@@ -167,7 +167,7 @@ enum udev_status udev_block(char *devnm)
int fd;
char *path = xcalloc(1, BUFSIZ);
- snprintf(path, BUFSIZ, "/run/mdadm/creating-%s", devnm);
+ snprintf(path, BUFSIZ, "%s/creating-%s", MAP_DIR, devnm);
fd = open(path, O_CREAT | O_RDWR, 0600);
if (!is_fd_valid(fd)) {