Browse Source

* Make modules/system/boot/stage-1.nix a proper module that exports

the initial ramdisk as config.system.build.bootStage1.

svn path=/nixos/branches/modular-nixos/; revision=15739
nsd-state-dir
Eelco Dolstra 13 years ago
parent
commit
7ac0b3aaea
  1. 15
      default.nix
  2. 19
      modules/system/boot/stage-1.nix
  3. 1
      system/options.nix
  4. 10
      system/system.nix

15
default.nix

@ -24,21 +24,6 @@ in
config
;
inherit (system.nixosTools)
nixosCheckout
nixosHardwareScan
nixosInstall
nixosRebuild
nixosGenSeccureKeys
;
inherit (system.initialRamdiskStuff)
bootStage1
extraUtils
initialRamdisk
modulesClosure
;
nix = system.config.environment.nix;
nixFallback = (import nixpkgs {}).nixUnstable;

19
modules/system/boot/stage-1.nix

@ -1,17 +1,13 @@
# This Nix expression builds the initial ramdisk, which contains an
# init script that performs the first stage of booting the system: it
# loads the modules necessary to mount the root file system, then
# calls the init in the root file system to start the second boot
# stage.
# This module builds the initial ramdisk, which contains an init
# script that performs the first stage of booting the system: it loads
# the modules necessary to mount the root file system, then calls the
# init in the root file system to start the second boot stage.
{pkgs, config}:
{pkgs, config, ...}:
let
kernelPackages = config.boot.kernelPackages;
modulesTree = config.system.modulesTree;
in
rec {
# Determine the set of modules that we need to mount the root FS.
@ -201,4 +197,9 @@ rec {
];
};
in {
system.build.bootStage1 = bootStage1;
system.build.initialRamdisk = initialRamdisk;
}

1
system/options.nix

@ -446,6 +446,7 @@ in
../modules/services/x11/xserver/default.nix
../modules/system/activation/activation-script.nix
../modules/system/boot/kernel.nix
../modules/system/boot/stage-1.nix
../modules/system/boot/stage-2.nix
../modules/system/upstart-events/ctrl-alt-delete.nix
../modules/system/upstart-events/halt.nix

10
system/system.nix

@ -26,14 +26,6 @@ rec {
pkgs = import nixpkgs {system = platform;};
# The initial ramdisk.
initialRamdiskStuff = import ../modules/system/boot/stage-1.nix {
inherit pkgs config;
};
initialRamdisk = initialRamdiskStuff.initialRamdisk;
# This attribute is responsible for creating boot entries for
# child configuration. They are only (directly) accessible
# when the parent configuration is boot default. For example,
@ -66,7 +58,7 @@ rec {
inherit children;
configurationName = config.boot.configurationName;
kernel = config.boot.kernelPackages.kernel + "/vmlinuz";
initrd = initialRamdisk + "/initrd";
initrd = config.system.build.initialRamdisk + "/initrd";
# Most of these are needed by grub-install.
path = [
pkgs.coreutils

Loading…
Cancel
Save