Lower the default console log level

It used to be set to 7 (debug) so you get lots of crap on the console.
The new value of 4 is also what Ubuntu uses.  Red Hat uses 3.

A nice side effect is that it's more likely that the LUKS passphrase
prompt doesn't get clobbered by kernel log messages.
This commit is contained in:
Eelco Dolstra 2013-07-23 20:43:11 +02:00
parent 8dc09be07b
commit 438b057eb3
2 changed files with 16 additions and 0 deletions

View File

@ -54,6 +54,16 @@ in
description = "Additional user-defined kernel parameters.";
};
boot.consoleLogLevel = mkOption {
type = types.int;
default = 4;
description = ''
The kernel console log level. Only log messages with a
priority numerically less than this will appear on the
console.
'';
};
boot.vesa = mkOption {
default = config.boot.kernelPackages.splashutils != null;
example = false;
@ -146,9 +156,14 @@ in
system.modulesTree = [ kernel ] ++ config.boot.extraModulePackages;
# Implement consoleLogLevel both in early boot and using sysctl
# (so you don't need to reboot to have changes take effect).
boot.kernelParams =
[ "loglevel=${toString config.boot.consoleLogLevel}" ] ++
optionals config.boot.vesa [ "splash=verbose" "vga=0x317" ];
boot.kernel.sysctl."kernel.printk" = config.boot.consoleLogLevel;
boot.kernelModules = [ "loop" ];
boot.initrd.availableKernelModules =

View File

@ -66,6 +66,7 @@ mount -t devtmpfs -o "size=@devSize@" none /dev
mkdir -p /run
mount -t tmpfs -o "mode=0755,size=@runSize@" none /run
# Process the kernel command line.
export stage2Init=/init
for o in $(cat /proc/cmdline); do