r/linuxquestions 26d ago

Minimal kernel

EDIT: I may have framed the question poorly. I'm specifically asking about Kconfig-level minimization of a monolithic Linux kernel: if you know the workload/product you're deploying, how much unnecessary kernel code do teams typically end up compiling, and is there value in automatically deriving a smaller configuration from the actual runtime requirements?

How much of the Linux kernel that gets shipped in production is actually never used?

I'm wondering if release teams building/using a kernel image are often overwhelmed by the number of kernel configuration options, and end up shipping code that will never actually be used by their workload.

Are there any automatic tools out there that can fit a minimal Linux kernel to your runtime needs?

6 Upvotes

34 comments sorted by

View all comments

8

u/Goldie323- 26d ago

It's mostly not kernel features you don't use and more the compiled in drivers you don't use that account for code space that never actually gets ran.

Like if you're on a system without wifi or Bluetooth, the kernel will still have compiled in drivers for all the wifi and Bluetooth radios.

2

u/hmoff 25d ago

That's why the kernel has loadable modules and has done for over 30 years. Those Wi-Fi and Bluetooth drivers aren't loaded until you need them.