Convert "boot/boot-stage-2.nix" to a configuration file.

svn path=/nixos/branches/fix-style/; revision=13684
This commit is contained in:
Nicolas Pierron 2009-01-02 16:07:30 +00:00
parent 7cdb7d38ef
commit b67e2a12aa
3 changed files with 51 additions and 37 deletions

View File

@ -1,27 +1,51 @@
{ substituteAll, writeText, coreutils
, utillinux, kernel, udev, upstart
, activateConfiguration
{pkgs, config, ...}:
, # Whether the root device is read-only and should be made writable
# through a unionfs.
isLiveCD
let
inherit (pkgs) substituteAll writeText coreutils utillinux udev upstart;
kernel = config.boot.kernelPackages.kernel;
activateConfiguration = config.system.activationScripts.script;
inherit (config.boot) isLiveCD;
, # Path for Upstart jobs. Should be quite minimal.
upstartPath
, # User-supplied command to be run just before Upstart is started.
bootLocal ? ""
}:
substituteAll {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit kernel upstart isLiveCD activateConfiguration upstartPath;
path = [
coreutils
utillinux
udev
upstart
# Path for Upstart jobs. Should be quite minimal.
upstartPath = [
pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.upstart
];
bootLocal = writeText "local-cmds" bootLocal;
bootLocal = config.boot.localCommands;
bootStage2 = substituteAll {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit kernel upstart isLiveCD activateConfiguration upstartPath;
path = [
coreutils
utillinux
udev
upstart
];
bootLocal = writeText "local-cmds" bootLocal;
};
in
{
require = [
# config.boot.localCommands
# config.boot.kernelPackages
# config.system.activationScripts
(import ../system/activate-configuration.nix)
# config.system.build
(import ../system/system-options.nix)
];
system = {
build = {
inherit bootStage2;
};
};
}

View File

@ -2507,6 +2507,9 @@ in
};
require = [
# boot (is it the right place ?)
(import ../boot/boot-stage-2.nix)
# system
(import ../system/system-options.nix)
(import ../system/activate-configuration.nix)

View File

@ -191,20 +191,7 @@ rec {
# The init script of boot stage 2, which is supposed to do
# everything else to bring up the system.
bootStage2 = import ../boot/boot-stage-2.nix {
inherit (pkgs) substituteAll writeText coreutils
utillinux udev upstart;
inherit kernel activateConfiguration;
inherit (config.boot) isLiveCD;
upstartPath = [
pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.upstart
];
bootLocal = config.boot.localCommands;
};
bootStage2 = config.system.build.bootStage2;
# Script to build the Grub menu containing the current and previous