From dbc03fbf6835b9e19879df18f9d43e04cbd4f74a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Feb 2010 14:31:46 +0000 Subject: [PATCH] * nixos-install: copy /etc/nsswitch.conf to the chroot. This seems necessary to have it use /etc/hosts. svn path=/nixos/trunk/; revision=19905 --- modules/installer/tools/nixos-install.sh | 7 +++++-- tests/installer.nix | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/installer/tools/nixos-install.sh b/modules/installer/tools/nixos-install.sh index a9500f7e680..5b7746b6162 100644 --- a/modules/installer/tools/nixos-install.sh +++ b/modules/installer/tools/nixos-install.sh @@ -51,8 +51,11 @@ NIXOS=$(readlink -f "$NIXOS") # Enable networking in the chroot. mkdir -m 0755 -p $mountPoint/etc touch /etc/resolv.conf -cp /etc/resolv.conf $mountPoint/etc/ -cp /etc/hosts $mountPoint/etc/ +cp -f /etc/resolv.conf $mountPoint/etc/ +rm -f $mountPoint/etc/hosts +cat /etc/hosts > $mountPoint/etc/hosts +rm -f $mountPoint/etc/nsswitch.conf +cat /etc/nsswitch.conf > $mountPoint/etc/nsswitch.conf # Mount some stuff in the target root directory. mkdir -m 0755 -p $mountPoint/dev $mountPoint/proc $mountPoint/sys $mountPoint/mnt diff --git a/tests/installer.nix b/tests/installer.nix index bd2e79b9fe3..657846ae074 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -133,7 +133,8 @@ let ${optionalString testChannel '' # Allow the machine to talk to the fake nixos.org. $machine->mustSucceed( - "echo 192.168.1.1 nixos.org >> /etc/hosts", + "rm /etc/hosts", + "echo 192.168.1.1 nixos.org > /etc/hosts", "ifconfig eth1 up 192.168.1.2", "nix-pull http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/MANIFEST", ); @@ -174,13 +175,11 @@ let # Did /boot get mounted, if appropriate? # !!! There is currently no good way to wait for the # `filesystems' tash to finish. - #$machine->mustSucceed("initctl start filesystems"); - #$machine->mustSucceed("test -e /boot/grub/grub.cfg"); + $machine->waitForFile("/boot/grub/grub.cfg"); # Did the swap device get activated? # !!! Idem. - # $machine->waitForJob("swap"); - #$machine->mustSucceed("cat /proc/swaps | grep -q /dev"); + $machine->waitUntilSucceeds("cat /proc/swaps | grep -q /dev"); $machine->mustSucceed("nix-env -i coreutils >&2"); $machine->mustSucceed("type -tP ls") =~ /profiles/