summary refs log tree commit diff
path: root/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-10 19:00:29 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-10 19:00:29 +0000
commitac8a2ae57700e65e11396027993aab17b7187b51 (patch)
treefda99a8e27f740d2d61b34a18ac7f1dc72c92405 /modules/system/boot/stage-1.nix
parent5c66611f3ea82c690cf978b9b24eda7b2970c0bc (diff)
downloadnixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar.gz
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar.bz2
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar.lz
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar.xz
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.tar.zst
nixpkgs-ac8a2ae57700e65e11396027993aab17b7187b51.zip
* Use the LVM udev rules in stage 1. This makes
  /dev/disk/by-{label,uuid} paths available for LVM volumes.

svn path=/nixos/trunk/; revision=19334
Diffstat (limited to 'modules/system/boot/stage-1.nix')
-rw-r--r--modules/system/boot/stage-1.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix
index 137eaa9e379..504b1080bb7 100644
--- a/modules/system/boot/stage-1.nix
+++ b/modules/system/boot/stage-1.nix
@@ -133,7 +133,7 @@ let
 
       cp -pd ${pkgs.e2fsprogs}/lib/lib*.so.* $out/lib
 
-      # Copy dmsetup and lvm, if we need it.
+      # Copy dmsetup and lvm.
       cp ${pkgs.lvm2}/sbin/dmsetup $out/bin/dmsetup
       cp ${pkgs.lvm2}/sbin/lvm $out/bin/lvm
       cp ${pkgs.lvm2}/lib/libdevmapper.so.*.* $out/lib
@@ -211,6 +211,7 @@ let
       cp ${pkgs.udev}/libexec/rules.d/60-cdrom_id.rules $out/
       cp ${pkgs.udev}/libexec/rules.d/60-persistent-storage.rules $out/
       cp ${pkgs.udev}/libexec/rules.d/80-drivers.rules $out/
+      cp ${pkgs.lvm2}/lib/udev/rules.d/*.rules $out/
 
       for i in $out/*.rules; do
           substituteInPlace $i \
@@ -221,7 +222,9 @@ let
             --replace vol_id ${extraUtils}/bin/vol_id \
             --replace cdrom_id ${extraUtils}/bin/cdrom_id \
             --replace /sbin/blkid ${extraUtils}/bin/blkid \
-            --replace /sbin/modprobe ${extraUtils}/bin/modprobe
+            --replace /sbin/modprobe ${extraUtils}/bin/modprobe \
+            --replace '$env{DM_SBIN_PATH}/blkid' ${extraUtils}/bin/blkid \
+            --replace 'ENV{DM_SBIN_PATH}="/sbin"' 'ENV{DM_SBIN_PATH}="${extraUtils}/bin"'
       done
 
       # Remove rule preventing creation of a by-label symlink