Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mdadm: Enable incremental activation of swraid arrays from udev.
svn path=/nixpkgs/trunk/; revision=21805
- Loading branch information
Showing
2 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,32 @@ | ||
{stdenv, fetchurl, groff}: | ||
{ stdenv, fetchurl, groff }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "mdadm-3.1.2"; | ||
|
||
src = fetchurl { | ||
url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.bz2"; | ||
sha256 = "0s2d2a01j8cizxqvbgd0sn5bpa1j46q8976078b3jq1q7i1ir0zz"; | ||
}; | ||
|
||
buildNativeInputs = [groff]; | ||
# Enable incremental activation of swraid arrays from udev. | ||
patches = [ ./udev.patch ]; | ||
|
||
patchPhase = "sed -e 's@/lib/udev@\${out}/lib/udev@' -i Makefile"; | ||
buildNativeInputs = [ groff ]; | ||
|
||
preConfigure = "sed -e 's@/lib/udev@\${out}/lib/udev@' -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) | ||
makeFlagsArray=(INSTALL=install BINDIR=$out/sbin MANDIR=$out/share/man VAR_RUN=/var/run/mdadm ALT_RUN=/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; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --exclude '*~' -rc mdadm-3.1.2-orig/udev-md-raid.rules mdadm-3.1.2/udev-md-raid.rules | ||
*** mdadm-3.1.2-orig/udev-md-raid.rules 2010-02-22 21:14:58.000000000 +0100 | ||
--- mdadm-3.1.2/udev-md-raid.rules 2010-05-16 20:45:22.000000000 +0200 | ||
*************** | ||
*** 5,11 **** | ||
ACTION=="change", GOTO="md_no_incr" | ||
|
||
# import data from a raid member and activate it | ||
! #ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" | ||
# import data from a raid set | ||
LABEL="md_no_incr" | ||
KERNEL!="md*", GOTO="md_end" | ||
--- 5,11 ---- | ||
ACTION=="change", GOTO="md_no_incr" | ||
|
||
# import data from a raid member and activate it | ||
! ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" | ||
# import data from a raid set | ||
LABEL="md_no_incr" | ||
KERNEL!="md*", GOTO="md_end" |