From 23381ed03f0bc4783c57e72288afa52c85429f81 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 3 Nov 2006 00:36:08 +0000 Subject: [PATCH] * Add the module tools, util-linux and the kernel modules to the initrd. Of course, the next step is to only add the kernel modules that we're going to need. svn path=/nixu/trunk/; revision=6934 --- test/boot-stage-1-init.sh | 15 +++++++++++++++ test/boot-stage-1.nix | 8 ++++++-- test/rescue-system.nix | 10 +++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/test/boot-stage-1-init.sh b/test/boot-stage-1-init.sh index 782ff485c41..629e6c24745 100644 --- a/test/boot-stage-1-init.sh +++ b/test/boot-stage-1-init.sh @@ -9,10 +9,25 @@ echo export PATH=/empty for i in @path@; do PATH=$PATH:$i/bin + if test -e $i/sbin; then + PATH=$PATH:$i/sbin + fi done +# Mount special file systems. +mkdir /etc # to shut up mount +touch /etc/fstab # idem +mkdir /proc +mount -t proc proc /proc +mkdir /sys +mount -t sysfs sys /sys + # Create device nodes in /dev. source @makeDevices@ +# Load some kernel modules. +export MODULE_DIR=@kernel@ +modprobe ide_disk + # Start an interactive shell. exec @shell@ diff --git a/test/boot-stage-1.nix b/test/boot-stage-1.nix index e5477888862..9fed0020c76 100644 --- a/test/boot-stage-1.nix +++ b/test/boot-stage-1.nix @@ -4,14 +4,18 @@ # the second boot stage. The closure of the result of this expression # is supposed to be put into an initial RAM disk (initrd). -{genericSubstituter, shell, staticTools}: +{ genericSubstituter, shell, staticTools +, module_init_tools, utillinux, kernel +}: genericSubstituter { src = ./boot-stage-1-init.sh; isExecutable = true; - inherit shell; + inherit shell kernel; path = [ staticTools + module_init_tools + utillinux ]; makeDevices = ./make-devices.sh; } diff --git a/test/rescue-system.nix b/test/rescue-system.nix index 994723eef1f..9491e8538e5 100644 --- a/test/rescue-system.nix +++ b/test/rescue-system.nix @@ -14,10 +14,18 @@ rec { bash = pkgs.bash; + # Determine the set of modules that we need to mount the root FS. + modulesClosure = import ./modules-closure.nix { + inherit (pkgs) stdenv kernel; + rootModules = "ide-cd"; + }; + + # The init script of boot stage 1 (loading kernel modules for # mounting the root FS). bootStage1 = import ./boot-stage-1.nix { - inherit (pkgs) genericSubstituter; + inherit (pkgs) genericSubstituter + module_init_tools utillinux kernel; shell = stdenvLinuxStuff.bootstrapTools.bash; staticTools = stdenvLinuxStuff.staticTools; };