Patched kernel modules silently fail to build #10
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Intermittently when input
nixpkgs
is bumped and contains updates to kernel-related packages, patches and overrides for modules (such assnd-usb-audio
in this case) are not contained in the activated system.No build errors are emitted.
Last occurrence was between f9cf5758e3..f0e0cf2772.
Occurred again on
4aa27cf9bb
nix build --print-out-paths .#nixosConfigurations.odyssey.config.boot.kernelPackages.kernel
andrealpath /run/booted-system/kernel
shows the same kernel version is booted as was built./run/booted-system/kernel-modules/lib/modules/6.1.69/extra
contains the patched module.Broken build
Store paths
/nix/store/63js36518q1bgx4rniglkq43skg7rgxp-linux-6.1.69
/nix/store/k9104pjccqsagr4742312vk24ljh7wcw-kernel-modules
/nix/store/j5ckfhkbarzy702kmi5bd059014qiaj8-initrd-linux-6.1.69
/nix/store/r9l8j7ja6611h091pl0sicvr2rsyir6a-snd-usb-audio-6.1.69
Module contained in kernel subtree is unpatched (SHA-256: 49e6366345aa422a74ceb88adaa91a1eeee935b83c06caff9d774007d75d194e), module contained in extra subtree is patched (SHA-256: 6df98f7188bb5e3f5987709db087028b1470c2d9bc9c4f436baeb088071c63d8).
In
modules.dep
fromkernel-modules
, only the original kernel version has an entry:kernel/sound/usb/snd-usb-audio.ko.xz
.Working build
Store paths
/nix/store/s5s7h6rars5q2jkdc4px448lywvxclvl-linux-6.1.68
/nix/store/405sghj6sxnjrdfi5jssaqbs3kk33wid-kernel-modules
/nix/store/n0sp3cmmskg9105w54028iw3b0bv157v-initrd-linux-6.1.68
/nix/store/dkm9saizmdcac48cv713lx04dnv1wa3g-snd-usb-audio-6.1.68
Module contained in kernel subtree is unpatched (SHA-256: ee0db8570aeac66dbe1ac76f3aeff0e6692ccda69339f92170ba6d8358b7afdc), module contained in extra subtree is patched (SHA-256: 0cab2404b9f0afebcdb023648b44404ca588d7aab47ff033c62520add197be6a).
extra/snd-usb-audio.ko.xz
has an entry inmodules.dep
fromkernel-modules
.On kernel upgrade,
modules.dep
(generated by depmod either here or here) seems to be called using only the module subtree relevant to the new kernel, rather than the entire module tree (includingextra
).Related comment in nixpkgs issue: https://github.com/NixOS/nixpkgs/issues/56040#issuecomment-482878657
After adding
boot.kernelModules = [ "snd-usb-audio" ];
inf44a098f80
it seems like the derivation now contains a correctmodules.dep
file.Store paths
/nix/store/nvf2lyvczsnj08gzzx556q5q5fb3ypgp-kernel-modules
Issue re-occurring on latest
nixpkgs
. Related discussion: https://discourse.nixos.org/t/best-way-to-handle-boot-extramodulepackages-kernel-module-conflictAdded workaround for PreSonus 1824c to reload snd_usb_audio from the correct location if the device doesn't appear to have been initialised.