* Options for overriding the set of kernel modules in the initrd.
svn path=/nixos/trunk/; revision=7432
This commit is contained in:
parent
2d6e8e63ae
commit
f9d67afce0
@ -56,10 +56,10 @@ source @makeDevices@
|
|||||||
|
|
||||||
|
|
||||||
# Load some kernel modules.
|
# Load some kernel modules.
|
||||||
export MODULE_DIR=@modules@/lib/modules/
|
export MODULE_DIR=@modulesDir@/lib/modules/
|
||||||
modprobe ide-generic
|
for i in @modules@; do
|
||||||
modprobe ide-disk
|
modprobe $i
|
||||||
modprobe ide-cd
|
done
|
||||||
|
|
||||||
|
|
||||||
# Try to find and mount the root device.
|
# Try to find and mount the root device.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# is supposed to be put into an initial RAM disk (initrd).
|
# is supposed to be put into an initial RAM disk (initrd).
|
||||||
|
|
||||||
{ substituteAll, staticShell, staticTools
|
{ substituteAll, staticShell, staticTools
|
||||||
, module_init_tools, extraUtils, modules
|
, module_init_tools, extraUtils, modules, modulesDir
|
||||||
|
|
||||||
, # Whether to find root device automatically using its label.
|
, # Whether to find root device automatically using its label.
|
||||||
autoDetectRootDevice
|
autoDetectRootDevice
|
||||||
@ -24,7 +24,7 @@
|
|||||||
substituteAll {
|
substituteAll {
|
||||||
src = ./boot-stage-1-init.sh;
|
src = ./boot-stage-1-init.sh;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit staticShell modules;
|
inherit staticShell modules modulesDir;
|
||||||
inherit autoDetectRootDevice;
|
inherit autoDetectRootDevice;
|
||||||
rootDevice = if !autoDetectRootDevice then rootDevice else "";
|
rootDevice = if !autoDetectRootDevice then rootDevice else "";
|
||||||
rootLabel = if autoDetectRootDevice then rootLabel else "";
|
rootLabel = if autoDetectRootDevice then rootLabel else "";
|
||||||
|
@ -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"];
|
name = ["networking" "useDHCP"];
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -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.
|
# Determine the set of modules that we need to mount the root FS.
|
||||||
modulesClosure = import ../helpers/modules-closure.nix {
|
modulesClosure = import ../helpers/modules-closure.nix {
|
||||||
inherit (pkgs) stdenv kernel module_init_tools;
|
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"];
|
rootDevice = config.get ["boot" "rootDevice"];
|
||||||
rootLabel = config.get ["boot" "rootLabel"];
|
rootLabel = config.get ["boot" "rootLabel"];
|
||||||
inherit stage2Init;
|
inherit stage2Init;
|
||||||
modules = modulesClosure;
|
modulesDir = modulesClosure;
|
||||||
|
modules = rootModules;
|
||||||
staticShell = stdenvLinuxStuff.bootstrapTools.bash;
|
staticShell = stdenvLinuxStuff.bootstrapTools.bash;
|
||||||
staticTools = stdenvLinuxStuff.staticTools;
|
staticTools = stdenvLinuxStuff.staticTools;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user