From f25ce41c1854dbf1fcfec084c45c364ee76796c1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Dec 2006 23:34:42 +0000 Subject: [PATCH] * Option boot.doHardwareScan to disable the hardware scan. Also, if the flag "safemode" is specified on the kernel command line, also disable the hardware scan. * Option boot.kernelModules to specify a set of modules to be loaded in stage 2 (in addition to the initrd modules in boot.initrd.kernelModules). svn path=/nixos/trunk/; revision=7466 --- boot/boot-stage-2-init.sh | 7 +++++++ configuration/options.nix | 32 +++++++++++++++++++++++++++++++- configuration/system.nix | 4 ++-- configuration/upstart.nix | 2 ++ upstart-jobs/hardware-scan.nix | 23 ++++++++++++++++------- 5 files changed, 58 insertions(+), 10 deletions(-) diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index a29b874c032..02e33b91912 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -59,6 +59,9 @@ for o in $(cat /proc/cmdline); do # !!! argh, can't pass a startup event to Upstart yet. exec @shell@ ;; + safemode) + safeMode=1 + ;; esac done @@ -75,6 +78,10 @@ needWritableDir /root 0700 # Miscellaneous boot time cleanup. rm -rf /var/run +if test -n "$safeMode"; then + touch /var/run/safemode +fi + # Create the minimal device nodes needed before we run udev. mknod -m 0666 /dev/null c 1 3 diff --git a/configuration/options.nix b/configuration/options.nix index d128f6c8e33..aaafca84e99 100644 --- a/configuration/options.nix +++ b/configuration/options.nix @@ -84,6 +84,33 @@ } + { + name = ["boot" "hardwareScan"]; + default = true; + description = " + Whether to try to load kernel modules for all detected hardware. + Usually this does a good job of providing you with the modules + you need, but sometimes it can crash the system or cause other + nasty effects. If the hardware scan is turned on, it can be + disabled at boot time by adding the safemode + parameter to the kernel command line. + "; + } + + + { + name = ["boot" "kernelModules"]; + default = []; + description = " + The set of kernel modules to be loaded in the second stage of + the boot process. That is, these modules are not included in + the initial ramdisk, so they'd better not be required for + mounting the root file system. Add them to +