mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
* 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.
|
||||
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.
|
||||
|
|
|
@ -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 "";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue