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-06-01 15:53:24 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-06-01 15:53:24 +0000
commitdc49a0ce3f79587e61ea2017be37fca21bf3c0d8 (patch)
treeb8529596f16553b177f1840aebc3109717ae06b8 /modules/system/boot/stage-1.nix
parenteb4c33eecabf30b9e5dd298e396d3046daa60001 (diff)
downloadnixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar.gz
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar.bz2
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar.lz
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar.xz
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.tar.zst
nixpkgs-dc49a0ce3f79587e61ea2017be37fca21bf3c0d8.zip
* Don't use klibc in the initrd. It's simpler (and slightly smaller)
  to use the standard (coreutils) tools.
* Use util-linux's `switch_root' to switch over to the target root
  FS.  It automatically moves over the /dev, /proc and /sys from stage
  1, so stage 2 doesn't need to set them up again.

svn path=/nixos/trunk/; revision=22085
Diffstat (limited to 'modules/system/boot/stage-1.nix')
-rw-r--r--modules/system/boot/stage-1.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix
index 013872aa2a7..c822c848b30 100644
--- a/modules/system/boot/stage-1.nix
+++ b/modules/system/boot/stage-1.nix
@@ -114,13 +114,17 @@ let
 
       # Copy some utillinux stuff.
       cp -v ${pkgs.utillinux}/bin/mount ${pkgs.utillinux}/bin/umount \
-         ${pkgs.utillinux}/sbin/fsck ${pkgs.utillinux}/sbin/pivot_root \
+         ${pkgs.utillinux}/sbin/fsck ${pkgs.utillinux}/sbin/switch_root \
          ${pkgs.utillinux}/sbin/blkid $out/bin
       cp -pdv ${pkgs.utillinux}/lib/libblkid*.so.* $out/lib
       cp -pdv ${pkgs.utillinux}/lib/libuuid*.so.* $out/lib
 
       # Copy some coreutils.
       cp -v ${pkgs.coreutils}/bin/basename $out/bin
+      cp -v ${pkgs.coreutils}/bin/mkdir $out/bin
+      cp -v ${pkgs.coreutils}/bin/mknod $out/bin
+      cp -v ${pkgs.coreutils}/bin/cat $out/bin
+      cp -v ${pkgs.coreutils}/bin/chroot $out/bin
 
       # Copy e2fsck and friends.      
       cp -v ${pkgs.e2fsprogs}/sbin/e2fsck $out/bin
@@ -256,11 +260,9 @@ let
 
     isExecutable = true;
 
-    klibc = pkgs.klibcShrunk;
-
     inherit udevConf extraUtils;
 
-    inherit (config.boot) resumeDevice;
+    inherit (config.boot) resumeDevice devSize;
 
     inherit (config.boot.initrd) checkJournalingFS
       postDeviceCommands postMountCommands kernelModules;