From 80f83391724818a23c8699658ec0c211800ef9ef Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 20 Sep 2026 20:51:57 -0400 Subject: [PATCH] nixos/hyperv-guest: Kernel module and param tweaks The kernel warns during boot: "Kernel parameter elevator= does not have any effect anymore." It seems that parameter is been ignored since at least 2019: https://github.com/torvalds/linux/commit/f8db383507d658c5a729b062c97710efda876cd4 The kernel modules all have aliases that should enable udev to automatically load them; so they do not need to be in `kernelModules`. They probably don't need to be in stage 1 at all, except for `hv_storvsc`, but I don't want to potentially break anything that hyperv users may be depending on. Having these modules in `kernelModules` means the ISO always tries to load these modules, but they normally fail to load on real hardware, which results in a confusing, but harmless, error message about `systemd-modules-load.service` failing during stage 1, which users often assume is the reason for the ISO failing to boot on their machine when it's not. I don't necessarily think hyperv guest stuff should be enabled in the ISO in the first place, but I would need to do more careful investigation to be sure. For now, it suffices to just move them to `availableKernelModules`. --- nixos/modules/virtualisation/hyperv-guest.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix index 9161cacdd400..c9eb8dfd7db0 100644 --- a/nixos/modules/virtualisation/hyperv-guest.nix +++ b/nixos/modules/virtualisation/hyperv-guest.nix @@ -28,18 +28,13 @@ in config = mkIf cfg.enable { boot = { - initrd.kernelModules = [ + initrd.availableKernelModules = [ "hv_balloon" "hv_netvsc" "hv_storvsc" "hv_utils" "hv_vmbus" - ]; - - initrd.availableKernelModules = [ "hyperv_keyboard" ]; - - kernelParams = [ - "elevator=noop" + "hyperv_keyboard" ]; };