From 1cec62ba5d76dd842b4cd1afe014bf86fb94b036 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 4 Nov 2006 13:25:10 +0000 Subject: [PATCH] * Add additional packages to the path of the interactive shell started at the end of stage 2. * Stage 2: set MODULE_DIR to point at a full module tree. svn path=/nixu/trunk/; revision=6954 --- test/boot-stage-2-init.sh | 11 +++++++++++ test/boot-stage-2.nix | 5 +++-- test/rescue-system.nix | 24 +++++++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) 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 + ]; };