···
If enabled, NixOS will set up a kernel that will
21
-
boot on crash, and leave the user to a stage1 debug1devices
22
-
interactive shell to be able to save the crashed kernel dump.
21
+
boot on crash, and leave the user in systemd rescue
22
+
to be able to save the crashed kernel dump at
It also activates the NMI watchdog.
26
-
kernelPackages = mkOption {
27
-
type = types.package;
28
-
default = pkgs.linuxPackages;
29
-
# We don't want to evaluate all of linuxPackages for the manual
30
-
# - some of it might not even evaluate correctly.
31
-
defaultText = "pkgs.linuxPackages";
32
-
example = literalExample "pkgs.linuxPackages_2_6_25";
27
+
reservedMemory = mkOption {
34
-
This will override the boot.kernelPackages, and will add some
35
-
kernel configuration parameters for the crash dump to work.
30
+
The amount of memory reserved for the crashdump kernel.
31
+
If you choose a too high value, dmesg will mention
32
+
"crashkernel reservation failed".
kernelParams = mkOption {
type = types.listOf types.str;
40
-
default = [ "debug1devices" ];
37
+
default = [ "1" "boot.shell_on_fail" ];
Parameters that will be passed to the kernel kexec-ed on crash.
···
config = mkIf crashdump.enable {
51
+
echo "loading crashdump kernel...";
${pkgs.kexectools}/sbin/kexec -p /run/current-system/kernel \
--initrd=/run/current-system/initrd \
56
-
--append="init=$(readlink -f /run/current-system/init) system=$(readlink -f /run/current-system) irqpoll maxcpus=1 reset_devices ${kernelParams}" --reset-vga --console-vga
54
+
--reset-vga --console-vga \
55
+
--command-line="systemConfig=$(readlink -f /run/current-system) init=$(readlink -f /run/current-system/init) irqpoll maxcpus=1 reset_devices ${kernelParams}"
58
+
"crashkernel=${crashdump.reservedMemory}"
64
-
kernelPackages = mkOverride 50 (crashdump.kernelPackages // {
65
-
kernel = crashdump.kernelPackages.kernel.override
67
-
extraConfig = (optionalString (attrs ? extraConfig) attrs.extraConfig) +
64
+
name = "crashdump-config";