diff --git a/boot/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh index e3b26127d464..f1cad685e357 100644 --- a/boot/boot-stage-1-init.sh +++ b/boot/boot-stage-1-init.sh @@ -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. diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index 63c562a13b9e..e33178f6881a 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -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 ""; diff --git a/configuration/options.nix b/configuration/options.nix index 4ed40d97a1f3..cd7f2a929d88 100644 --- a/configuration/options.nix +++ b/configuration/options.nix @@ -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 +