diff --git a/hosts/beefy/default.nix b/hosts/beefy/default.nix index 70d224e..62e9a1b 100644 --- a/hosts/beefy/default.nix +++ b/hosts/beefy/default.nix @@ -24,10 +24,27 @@ boot.kernelParams = [ "consoleblank=300" "nmi_watchdog=1" ]; # Netconsole - stream kernel messages to zippy (192.168.1.2) + # Must configure via configfs after network is up (interface doesn't exist at module load) boot.kernelModules = [ "netconsole" ]; - boot.extraModprobeConfig = '' - options netconsole netconsole=@/enp1s0,6666@192.168.1.2/c0:3f:d5:62:55:bb - ''; + boot.kernel.sysctl."kernel.printk" = "8 4 1 7"; # Raise console_loglevel to send all messages + systemd.services.netconsole-sender = { + description = "Configure netconsole to send kernel messages to zippy"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + script = '' + mkdir -p /sys/kernel/config/netconsole/target1 + echo enp1s0 > /sys/kernel/config/netconsole/target1/dev_name + echo 192.168.1.2 > /sys/kernel/config/netconsole/target1/remote_ip + echo 6666 > /sys/kernel/config/netconsole/target1/remote_port + echo c0:3f:d5:62:55:bb > /sys/kernel/config/netconsole/target1/remote_mac + echo 1 > /sys/kernel/config/netconsole/target1/enabled + ''; + }; # Kdump for kernel crash analysis boot.crashDump = {