* A minimal boot script for stage 1 of the boot (loading kernel
modules). The closure of the boot script is all we need in the initrd. svn path=/nixu/trunk/; revision=6929
This commit is contained in:
parent
3336325781
commit
2d31e1b6d6
|
@ -0,0 +1,17 @@
|
||||||
|
#! @shell@
|
||||||
|
|
||||||
|
# Print a greeting.
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
<<< NixOS Stage 1 >>>
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Set the PATH.
|
||||||
|
export PATH=/empty
|
||||||
|
for i in @path@; do
|
||||||
|
PATH=$PATH:$i/bin
|
||||||
|
done
|
||||||
|
|
||||||
|
# Start an interactive shell.
|
||||||
|
exec @shell@
|
|
@ -0,0 +1,16 @@
|
||||||
|
# This Nix expression builds the script that performs the first stage
|
||||||
|
# of booting the system: it loads the modules necessary to mount the
|
||||||
|
# root file system, then calls /init in the root file system to start
|
||||||
|
# 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 {
|
||||||
|
src = ./boot-stage-1-init.sh;
|
||||||
|
isExecutable = true;
|
||||||
|
inherit shell;
|
||||||
|
path = [
|
||||||
|
staticTools
|
||||||
|
];
|
||||||
|
}
|
|
@ -3,4 +3,4 @@ prompt 1
|
||||||
timeout 60
|
timeout 60
|
||||||
label linux
|
label linux
|
||||||
kernel vmlinuz
|
kernel vmlinuz
|
||||||
append initrd=initrd
|
append initrd=initrd selinux=0 apm=on acpi=on
|
||||||
|
|
|
@ -2,6 +2,10 @@ rec {
|
||||||
|
|
||||||
pkgs = import ./pkgs/top-level/all-packages.nix {};
|
pkgs = import ./pkgs/top-level/all-packages.nix {};
|
||||||
|
|
||||||
|
pkgsDiet = import ./pkgs/top-level/all-packages.nix {
|
||||||
|
bootStdenv = pkgs.useDietLibC pkgs.stdenv;
|
||||||
|
};
|
||||||
|
|
||||||
stdenvLinuxStuff = import ./pkgs/stdenv/linux {
|
stdenvLinuxStuff = import ./pkgs/stdenv/linux {
|
||||||
system = pkgs.stdenv.system;
|
system = pkgs.stdenv.system;
|
||||||
allPackages = import ./pkgs/top-level/all-packages.nix;
|
allPackages = import ./pkgs/top-level/all-packages.nix;
|
||||||
|
@ -10,15 +14,26 @@ rec {
|
||||||
bash = pkgs.bash;
|
bash = pkgs.bash;
|
||||||
|
|
||||||
|
|
||||||
initialRamdisk = import ./make-initrd.nix {
|
# The init script of boot stage 1 (loading kernel modules for
|
||||||
inherit (pkgs) stdenv cpio;
|
# mounting the root FS).
|
||||||
packages = [
|
bootStage1 = import ./boot-stage-1.nix {
|
||||||
stdenvLinuxStuff.staticTools
|
inherit (pkgs) genericSubstituter;
|
||||||
];
|
shell = stdenvLinuxStuff.bootstrapTools.bash;
|
||||||
init = stdenvLinuxStuff.bootstrapTools.bash;
|
staticTools = stdenvLinuxStuff.staticTools;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# The closure of the init script of boot stage 1 is what we put in
|
||||||
|
# the initial RAM disk.
|
||||||
|
initialRamdisk = import ./make-initrd.nix {
|
||||||
|
inherit (pkgs) stdenv cpio;
|
||||||
|
packages = [];
|
||||||
|
init = bootStage1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Create an ISO image containing the isolinux boot loader, the
|
||||||
|
# kernel, and initrd produced above.
|
||||||
rescueCD = import ./make-iso9660-image.nix {
|
rescueCD = import ./make-iso9660-image.nix {
|
||||||
inherit (pkgs) stdenv cdrtools;
|
inherit (pkgs) stdenv cdrtools;
|
||||||
isoName = "nixos.iso";
|
isoName = "nixos.iso";
|
||||||
|
|
Loading…
Reference in New Issue