mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
* 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
This commit is contained in:
parent
eb4c33eeca
commit
dc49a0ce3f
6 changed files with 32 additions and 44 deletions
|
@ -160,17 +160,20 @@ in
|
|||
''
|
||||
# We need mke2fs in the initrd.
|
||||
cp ${pkgs.e2fsprogs}/sbin/mke2fs $out/bin
|
||||
|
||||
# And `ifconfig'.
|
||||
cp ${pkgs.nettools}/sbin/ifconfig $out/bin
|
||||
'';
|
||||
|
||||
boot.initrd.postDeviceCommands =
|
||||
''
|
||||
# Set up networking. Needed for CIFS mounting.
|
||||
ipconfig 10.0.2.15:::::eth0:none
|
||||
ifconfig eth0 up 10.0.2.15
|
||||
|
||||
# If the disk image appears to be empty (fstype "unknown";
|
||||
# hacky!!!), run mke2fs to initialise.
|
||||
eval $(fstype /dev/vda)
|
||||
if test "$FSTYPE" = unknown; then
|
||||
# If the disk image appears to be empty, run mke2fs to
|
||||
# initialise.
|
||||
FSTYPE=$(blkid -o value -s TYPE /dev/vda || true)
|
||||
if test -z "$FSTYPE"; then
|
||||
mke2fs -t ext3 /dev/vda
|
||||
fi
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue