* Options for overriding the set of kernel modules in the initrd.

svn path=/nixos/trunk/; revision=7432
This commit is contained in:
Eelco Dolstra 2006-12-19 22:12:44 +00:00
parent 2d6e8e63ae
commit f9d67afce0
4 changed files with 41 additions and 8 deletions

View File

@ -56,10 +56,10 @@ source @makeDevices@
# Load some kernel modules.
export MODULE_DIR=@modules@/lib/modules/
modprobe ide-generic
modprobe ide-disk
modprobe ide-cd
export MODULE_DIR=@modulesDir@/lib/modules/
for i in @modules@; do
modprobe $i
done
# Try to find and mount the root device.

View File

@ -5,7 +5,7 @@
# is supposed to be put into an initial RAM disk (initrd).
{ substituteAll, staticShell, staticTools
, module_init_tools, extraUtils, modules
, module_init_tools, extraUtils, modules, modulesDir
, # Whether to find root device automatically using its label.
autoDetectRootDevice
@ -24,7 +24,7 @@
substituteAll {
src = ./boot-stage-1-init.sh;
isExecutable = true;
inherit staticShell modules;
inherit staticShell modules modulesDir;
inherit autoDetectRootDevice;
rootDevice = if !autoDetectRootDevice then rootDevice else "";
rootLabel = if autoDetectRootDevice then rootLabel else "";

View File

@ -93,6 +93,33 @@
}
{
name = ["boot" "initrd" "kernelModules"];
default = ["ide-cd" "ide-disk" "ide-generic" "ext3"];
description = "
The set of kernel modules in the initial ramdisk used during the
boot process. This set must include all modules necessary for
mounting the root device. That is, it should include modules
for the physical device (e.g., SCSI drivers) and for the file
system (e.g., ext3). The set specified here is automatically
closed under the module dependency relation, i.e., all
dependencies of the modules list here are included
automatically. If you want to add additional
modules, it's best to set
<option>boot.initrd.extraKernelModules</options>.
";
}
{
name = ["boot" "initrd" "extraKernelModules"];
default = [];
description = "
Additional kernel modules for the initial ramdisk.
";
}
{
name = ["networking" "useDHCP"];
default = true;

View File

@ -36,10 +36,15 @@ rec {
};
rootModules =
(config.get ["boot" "initrd" "kernelModules"]) ++
(config.get ["boot" "initrd" "extraKernelModules"]);
# Determine the set of modules that we need to mount the root FS.
modulesClosure = import ../helpers/modules-closure.nix {
inherit (pkgs) stdenv kernel module_init_tools;
rootModules = ["ide-cd" "ide-disk" "ide-generic"];
inherit rootModules;
};
@ -71,7 +76,8 @@ rec {
rootDevice = config.get ["boot" "rootDevice"];
rootLabel = config.get ["boot" "rootLabel"];
inherit stage2Init;
modules = modulesClosure;
modulesDir = modulesClosure;
modules = rootModules;
staticShell = stdenvLinuxStuff.bootstrapTools.bash;
staticTools = stdenvLinuxStuff.staticTools;
};