diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index 50069ebe2161..8235715e09e6 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -59,6 +59,18 @@ for i in /sys/bus/pci/devices/*/modalias; do modprobe $(cat $i) done +# Bring up the network devices. +modprobe af_packet +for i in $(cd /sys/class/net && ls -d *); do + echo "Bringing up network device $i..." + if ifconfig $i up; then + if test "$i" != "lo"; then + mkdir -p /var/state/dhcp + dhclient $i + fi + fi +done + # login/su absolutely need this. touch /etc/login.defs diff --git a/test/boot-stage-2.nix b/test/boot-stage-2.nix index 4b7ab3c318e1..4514d1779ad4 100644 --- a/test/boot-stage-2.nix +++ b/test/boot-stage-2.nix @@ -1,6 +1,6 @@ { genericSubstituter, shell, coreutils, findutils , utillinux, kernel, sysklogd, mingetty, udev -, module_init_tools +, module_init_tools, nettools, dhcp , path ? [] }: @@ -14,6 +14,8 @@ genericSubstituter { utillinux udev module_init_tools + nettools + dhcp ]; extraPath = path; makeDevices = ./make-devices.sh; diff --git a/test/rescue-system.nix b/test/rescue-system.nix index eda7cf599d49..fd22e482f2e3 100644 --- a/test/rescue-system.nix +++ b/test/rescue-system.nix @@ -64,8 +64,10 @@ rec { # everything else to bring up the system. bootStage2 = import ./boot-stage-2.nix { inherit (pkgs) genericSubstituter coreutils findutils - utillinux kernel sysklogd udev module_init_tools; + utillinux kernel sysklogd udev module_init_tools + nettools; shell = pkgs.bash + "/bin/sh"; + dhcp = pkgs.dhcpWrapper; # Additional stuff; add whatever you want here. path = [ @@ -83,8 +85,7 @@ rec { pkgs.less pkgs.nano pkgs.netcat - pkgs.nettools - pkgs.vim +# pkgs.vim pkgs.nix pkgs.strace pkgs.sysvinit