summary refs log tree commit diff
path: root/pkgs/os-specific/linux/mdadm
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2017-01-10 14:06:52 +0100
committerMichael Raskin <7c6f434c@mail.ru>2017-01-10 14:09:20 +0100
commit5b9d80646bc4878c467b9de96677b269145ee794 (patch)
tree2794a75384b4480921a219e5b2a2dc8c818355dc /pkgs/os-specific/linux/mdadm
parent93197aabea48d19ae3504bd8d082648fb48056e4 (diff)
downloadnixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar.gz
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar.bz2
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar.lz
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar.xz
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.tar.zst
nixpkgs-5b9d80646bc4878c467b9de96677b269145ee794.zip
mdadm4: init at 4.0
Would be just mdadm: 3.3.4 -> 4.0, but it doesn't look like there are
urgent bugfixes, and it is a major release, and wrong RAID handling
kills data, so let's let the early adopters test it a bit.
Diffstat (limited to 'pkgs/os-specific/linux/mdadm')
-rw-r--r--pkgs/os-specific/linux/mdadm/4.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/mdadm/4.nix b/pkgs/os-specific/linux/mdadm/4.nix
new file mode 100644
index 00000000000..d929668a26a
--- /dev/null
+++ b/pkgs/os-specific/linux/mdadm/4.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, groff }:
+
+assert stdenv.isLinux;
+
+stdenv.mkDerivation rec {
+  name = "mdadm-4.0";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.xz";
+    sha256 = "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx";
+  };
+
+  # This is to avoid self-references, which causes the initrd to explode
+  # in size and in turn prevents mdraid systems from booting.
+  allowedReferences = [ stdenv.glibc.out ];
+
+  patches = [ ./no-self-references.patch ];
+
+  makeFlags = [
+    "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
+    "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
+  ] ++ stdenv.lib.optionals (stdenv ? cross) [
+    "CROSS_COMPILE=${stdenv.cross.config}-"
+  ];
+
+  nativeBuildInputs = [ groff ];
+
+  # Attempt removing if building with gcc5 when updating
+  NIX_CFLAGS_COMPILE = "-std=gnu89";
+
+  preConfigure = ''
+    sed -e 's@/lib/udev@''${out}/lib/udev@' \
+        -e 's@ -Werror @ @' \
+        -e 's@/usr/sbin/sendmail@/var/setuid-wrappers/sendmail@' -i Makefile
+  '';
+
+  meta = {
+    description = "Programs for managing RAID arrays under Linux";
+    homepage = http://neil.brown.name/blog/mdadm;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}