nixpkgs/pkgs/os-specific/linux/mdadm/default.nix
Eelco Dolstra 666cf992f0 Revert "mdadm: update from 3.3 to 3.3.2"
This reverts commit 1faf6106c3. It
causes the size of the initrd to explode from ~6 MB to 19 MB:

  http://hydra.nixos.org/build/15728196

The reason is that mdadm now contains a self-reference:

  $ strings ./result/sbin/mdadm  | grep /nix/store
  ...
  ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="%s", ENV{ID_PATH}=="%s", RUN+="/nix/store/y1ap6va0av6jhxf7ddnr8vdwxd7b44gd-mdadm-3.3.2/sbin/mdadm --incremental $env{DEVNAME}"
  ACTION=="add", SUBSYSTEM=="block", ENV{ID_PATH}=="%s", RUN+="/nix/store/y1ap6va0av6jhxf7ddnr8vdwxd7b44gd-mdadm-3.3.2/sbin/mdadm --incremental $env{DEVNAME}"
/nix/store/y1ap6va0av6jhxf7ddnr8vdwxd7b44gd-mdadm-3.3.2/sbin/mdmon

(Previously, it referred to /sbin/mdadm.) This causes mdadm, glibc and
linux-headers to be added to the initrd.
2014-10-09 18:34:37 +02:00

30 lines
830 B
Nix

{ stdenv, fetchurl, groff }:
stdenv.mkDerivation rec {
name = "mdadm-3.3";
src = fetchurl {
url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.bz2";
sha256 = "0igdqflihiq1dp5qlypzw0xfl44f4n3bckl7r2x2wfgkplcfa1ww";
};
nativeBuildInputs = [ groff ];
preConfigure = "sed -e 's@/lib/udev@\${out}/lib/udev@' -e 's@ -Werror @ @' -i Makefile";
# Force mdadm to use /var/run/mdadm.map for its map file (or
# /dev/.mdadm/map as a fallback).
preBuild =
''
makeFlagsArray=(INSTALL=install BINDIR=$out/sbin MANDIR=$out/share/man RUN_DIR=/dev/.mdadm)
if [[ -n "$crossConfig" ]]; then
makeFlagsArray+=(CROSS_COMPILE=$crossConfig-)
fi
'';
meta = {
description = "Programs for managing RAID arrays under Linux";
homepage = http://neil.brown.name/blog/mdadm;
};
}