The officially official Devuan Forum!

You are not logged in.

#1 2024-10-24 20:54:59

peterrooney
Member
From: PNW
Registered: 2021-09-25
Posts: 5  

Unusual kernel defconfigs

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

#2 2024-10-24 22:18:14

quickfur
Member
Registered: 2023-12-14
Posts: 431  

Re: Unusual kernel defconfigs

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. big_smile  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

#3 2024-10-24 23:55:38

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 646  

Re: Unusual kernel defconfigs

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

#4 2024-10-25 01:18:57

peterrooney
Member
From: PNW
Registered: 2021-09-25
Posts: 5  

Re: Unusual kernel defconfigs

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

#5 2024-10-25 03:35:59

peterrooney
Member
From: PNW
Registered: 2021-09-25
Posts: 5  

Re: Unusual kernel defconfigs

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

#6 2024-10-25 06:19:19

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 646  

Re: Unusual kernel defconfigs

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

#7 2024-10-25 17:21:30

fanderal
Member
Registered: 2017-01-14
Posts: 86  

Re: Unusual kernel defconfigs

peterrooney wrote:

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

#8 2024-10-26 07:58:49

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 206  

Re: Unusual kernel defconfigs

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!

Online

#9 2024-10-26 23:54:46

peterrooney
Member
From: PNW
Registered: 2021-09-25
Posts: 5  

Re: Unusual kernel defconfigs

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

#10 2024-10-27 11:22:22

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 206  

Re: Unusual kernel defconfigs

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!

Online

Board footer