I may be wrong here, but I’ve heard that the original Linux kernel binaries+blobs are pretty huge, including not just the hardware available on my device, but also other irrelevant stuff that is probably not needed. It is kinda pointless to trim kernel on a normal device, I admit it, perhaps it could be useful for embedded systems, but I’d still want to give it a try. How do I go about doing this on NixOS? And will this change affect the detection of USB and microSD card?
You can grab the kernel source and run
make localmodconfig
to generate a kernel config based on the currently loaded modules.Then in nixos you can override the kernel config with that one (sorry, I can’t get the exact instructions right now).
You’ll need to make manual config changes for anything you might need to load dynamically.
I’ve heard that the original Linux kernel binaries+blobs are pretty huge
The kernel is <10MB and the initrd <20MB. “Pretty huge” is relative here.
You could override your kernel and strip stuff out of the initrd and I can assure you that it’s going to be a lot of pain but it’s easier to just make a 1GB boot partition these days and pretty much never worry about bloat again.
@velox_vulnus I am trying out=of-tree package , for related purpose