You are not logged in.
Pages: 1
I'm going through the kernel menuconfig hoping to create a smaller desktop kernel.
Going through and looking at each option, it's striking how often I come across help text that reads like, "If you don't know what this is, it is safe to say no here" - yet it's enabled.
And there's a lot of help text that looks... legacy. Like, KVM. What common off-the-shelf processors nowadays do not support it?
So anyways, the question: is there a straightforward way to turn off the things that don't need enabling except for owning arcane hardware? I get that having gone to the trouble of writing a module might bias an author to suggest it needs to be on by default!
Offline
I regularly run kernels that I configure by hand. Usually when I see things that I don't need that are turned on, I just turn it off. If it breaks something later, then I know that I should've left it on. For the most part, if you know what's in your hardware, most options can be turned off. Recent kernels' configure scripts will automatically turn on stuff that are needed for features you explicitly turn on, so for the most part you won't run into any problems.
Many default kernel configs enable way too much stuff that I don't need, wasting time in compiling drivers I will never end up using and occupying RAM for nothing. This kind of config makes sense for upstream distributors because they need to ship a kernel that works with everyone's (or most people's) hardware. But when you're configuring the kernel for your own use, you already know exactly what hardware you have so most of the other stuff is just dead weight.
Offline
Hi, consider researching "make localmodconfig"
I think that is what you require.
""make localmodconfig" Create a config based on current config and loaded modules (lsmod). Disables any module option that is not needed for the loadedmodules."
I hope this helps.
<edit> added for clarity, this command also takes into account /etc/modules(.d) and any blacklisted modules therein.
from my notes,
"localmodconfig" make target. It does pretty much what you ask—it determines what modules you have running, and generates a .config making sure those modules are built. The "localyesconfig" target will compile those modules statically into the kernel rather than creating modules.
</edit>
Last edited by GlennW (2024-10-25 00:10:28)
pic from 1993, new guitar day.
Offline
Thank you, the localmodconfig target looks promising - except near as I can figure out, you have to have everything that you're ever going to use plugged in and enabled while you run make? A mild hassle, not an impossibility. Shall test.
Offline
Well this is disheartening. After running make localmodconfig, which prompted me for about 200 answers via readline (I just hit enter for all) I went and checked, for example, Networking Support. What I saw:
Amateur radio: enabled Yes. I have no such equipment.
Bluetooth: enabled Module. I have no such equipment.
RFSwithc: enabled Yes. I have no wireless.
Device Drivers -> Network Device Support:
- FibreChannel driver support: Enabled yes, I have no such equipment.
- FDDI Driver support: Enabled yes, I have no such equipment.
- HIPPI Driver support: Enabled yes, I have no such equipment.
- Wireless LAN: Everything enabled yes except Texas Instruments.
- ISDN Support: Enabled yes.
Network device support -> Ethernet device support:
- Pretty much every top-level network card driver enabled, despite my machine only having a Realtek 8169.
And so on. While R8169 was enabled as a module, clearly make localmodconfig *is not working as advertised* because at least hundred of things that should clearly be disabled are enabled.
I am tempted to file a bug report, but who with? devuan, debian, or Mr. Torvalds? I can't identify who is responsible for maintaining Kbuild.
I am not enthusiastic about reasearching the majority of the 6000+ kernel options. Surely there is a better way.
Offline
Well, I admit it's been quite a while since I last did a localmodconfig, sorry for the bum steer.
pic from 1993, new guitar day.
Offline
If you don't know what this is...
Know what you mean. Found cateee.net when I did what you're doing. These days I use it to check if a module can be blacklisted.
Offline
mostly for the convenience of future visitors to this thread:
https://docs.kernel.org/admin-guide/quickly-build-trimmed-linux.html
also should probably quote it regarding size/space requirements:
If your system uses techniques like Secure Boot, prepare it to permit starting self-compiled Linux kernels; install compilers and everything else needed for building Linux; make sure to have 12 Gigabyte free space in your home directory.
Last edited by stargate-sg1-cheyenne-mtn (2024-10-26 08:02:49)
Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!
Offline
That is certainly a helpful resource that I may use once I get past the main.
That said, *it is not working as advertised* for localmodconfig.
Offline
searched the forum for "compile kernel"(topic subject only) and this was the only direct hit:
https://dev1galaxy.org/viewtopic.php?id=4532
searching the same with "message text and topic subject" selected offers 4 pages of results.
Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!
Offline
Pages: 1