From 7ac0b3aaeadb1607662f16a19a9f693de9ef0bca Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 27 May 2009 08:14:06 +0000 Subject: [PATCH] * 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 --- default.nix | 15 --------------- modules/system/boot/stage-1.nix | 19 ++++++++++--------- system/options.nix | 1 + system/system.nix | 10 +--------- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/default.nix b/default.nix index affb6fdc3ea..30eff6c2e6a 100644 --- a/default.nix +++ b/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; diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 2ed82339629..f4dfdb931ec 100644 --- a/modules/system/boot/stage-1.nix +++ b/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; + } diff --git a/system/options.nix b/system/options.nix index e7fa0b8cb23..90add193c86 100644 --- a/system/options.nix +++ b/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 diff --git a/system/system.nix b/system/system.nix index 489ec65d841..ee9c6d25934 100644 --- a/system/system.nix +++ b/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