summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-08-26 08:43:29 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2020-08-26 08:43:29 +0200
commit081bd762e5faa4c1550fdffcce9d44401560ff20 (patch)
treeb9216e3726f1fcfb2cde52fb4d4a0a60667155fa /nixos/modules/system/boot/stage-1.nix
parent49aa28210808c1147728480685fc0f62f8f03636 (diff)
parentb61ad0afc2a70c148fcc823b678c954d7dae0041 (diff)
downloadnixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar.gz
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar.bz2
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar.lz
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar.xz
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.tar.zst
nixpkgs-081bd762e5faa4c1550fdffcce9d44401560ff20.zip
Merge staging-next into staging
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index ec5eadf69c3..36af5de4c90 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -36,7 +36,7 @@ let
     set -euo pipefail
 
     declare -A seen
-    declare -a left
+    left=()
 
     patchelf="${pkgs.buildPackages.patchelf}/bin/patchelf"
 
@@ -48,7 +48,7 @@ let
       done
     }
 
-    add_needed $1
+    add_needed "$1"
 
     while [ ''${#left[@]} -ne 0 ]; do
       next=''${left[0]}
@@ -87,7 +87,9 @@ let
   # copy what we need.  Instead of using statically linked binaries,
   # we just copy what we need from Glibc and use patchelf to make it
   # work.
-  extraUtils = pkgs.runCommandCC "extra-utils"
+  extraUtils = let
+    # Use lvm2 without udev support, which is the same lvm2 we already have in the closure anyways
+    lvm2 = pkgs.lvm2.override { udev = null; }; in pkgs.runCommandCC "extra-utils"
     { nativeBuildInputs = [pkgs.buildPackages.nukeReferences];
       allowedReferences = [ "out" ]; # prevent accidents like glibc being included in the initrd
     }
@@ -111,8 +113,8 @@ let
       copy_bin_and_libs ${pkgs.utillinux}/sbin/blkid
 
       # Copy dmsetup and lvm.
-      copy_bin_and_libs ${getBin pkgs.lvm2}/bin/dmsetup
-      copy_bin_and_libs ${getBin pkgs.lvm2}/bin/lvm
+      copy_bin_and_libs ${getBin lvm2}/bin/dmsetup
+      copy_bin_and_libs ${getBin lvm2}/bin/lvm
 
       # Add RAID mdadm tool.
       copy_bin_and_libs ${pkgs.mdadm}/sbin/mdadm