kernel/builder: fix depmod for kernel >= 6.6
An alternative to #699. Use the same solution from nixpkgs's linuxManualConfig (used by buildLinux): https://github.com/NixOS/nixpkgs/blob/f0a375cf7d1d33b2aa8264c4f8a0864f82fdebf2/pkgs/os-specific/linux/kernel/manual-config.nix#L160
https://github.com/NixOS/nixpkgs/blob/f0a375cf7d1d33b2aa8264c4f8a0864f82fdebf2/pkgs/os-specific/linux/kernel/manual-config.nix#L184-L185.
In #684 I did
https://github.com/mobile-nixos/mobile-nixos/pull/684/files#diff-d4e1a4a88bfb5c67f976abb91d538f188bcb25a3bed98ae706dedbc443e55d85R256
but I think I might like yours better
How can I test this? I tried executing sudo lsmod on my PinePhone (kernel 6.9.10) but got an empty output both with and without this PR. Am I doing something incorrectly? Maybe all the modules are built into the kernel and that's why I don't see any output.
Maybe all the modules are built into the kernel and that's why I don't see any output.
In addition to:
- https://github.com/mobile-nixos/mobile-nixos/blob/472073a51745cca03257cf625582252cdd04ec21/devices/families/mainline-chromeos-mt8183/kernel/default.nix#L33
- https://github.com/mobile-nixos/mobile-nixos/blob/472073a51745cca03257cf625582252cdd04ec21/devices/pine64-pinephone/kernel/default.nix#L37
I'll note that at this point in time, kernel modules are still an unanswered questions, truly... Modules can be used only for the same kernel that booted the system [this statement is a bit stricter than reality]. The kernel used to boot the system is not tied to the lifecycle of a generation. In turn, this means the only safe way to load kernel modules is to load them during stage-1 currently.