diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index a9e9c63708b..02b440f5a36 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -27,5 +27,16 @@ mount -t tmpfs none /tmp # Create device nodes in /dev. source @makeDevices@ +# Ensure that the module tools can find the kernel modules. +export MODULE_DIR=@kernel@/lib/modules/ + +# Additional path for the interactive shell. +for i in @extraPath@; do + PATH=$PATH:$i/bin + if test -e $i/sbin; then + PATH=$PATH:$i/sbin + fi +done + # Start an interactive shell. exec @shell@ diff --git a/test/boot-stage-2.nix b/test/boot-stage-2.nix index 5605bd593a5..8f68858f536 100644 --- a/test/boot-stage-2.nix +++ b/test/boot-stage-2.nix @@ -1,14 +1,15 @@ { genericSubstituter, shell, coreutils -, utillinux +, utillinux, kernel, path ? [] }: genericSubstituter { src = ./boot-stage-2-init.sh; isExecutable = true; - inherit shell; + inherit shell kernel; path = [ coreutils utillinux ]; + extraPath = path; makeDevices = ./make-devices.sh; } diff --git a/test/rescue-system.nix b/test/rescue-system.nix index 69899180baf..216cf2009f9 100644 --- a/test/rescue-system.nix +++ b/test/rescue-system.nix @@ -63,8 +63,30 @@ rec { # The init script of boot stage 2, which is supposed to do # everything else to bring up the system. bootStage2 = import ./boot-stage-2.nix { - inherit (pkgs) genericSubstituter coreutils utillinux; + inherit (pkgs) genericSubstituter coreutils utillinux kernel; shell = pkgs.bash + "/bin/sh"; + + # Additional stuff; add whatever you want here. + path = [ + pkgs.bash + pkgs.bzip2 + pkgs.cpio + pkgs.curl + pkgs.e2fsprogs + pkgs.findutils + pkgs.gnugrep + pkgs.gnused + pkgs.gnutar + pkgs.grub + pkgs.gzip + pkgs.iputils + pkgs.less + pkgs.module_init_tools + pkgs.nano + pkgs.netcat + pkgs.nettools + pkgs.vim + ]; };