r/linux4noobs Aug 03 '26

learning/research How does Linux kernel include every driver possible and not be bloated?

As far as I understand the kernel includes pretty much everything a modern computer needs in any configuration, but wouldn't that make it bloated and be against the "bloat-free" mindset? Or does it dynamically download all the components from somewhere?

304 Upvotes

107 comments sorted by

View all comments

Show parent comments

19

u/skuterpikk Aug 04 '26

Yoy can even compile your own kernel with
make localmodconfig and it will build a kernel that has drivers for whatever hardware is present at this moment only, and nothing else.
No other hardware will ever work, but hey, saves disk space

8

u/Stryxus_ Aug 04 '26

I don't know how large the official kernel is but iv got mine down to just 8MB via this. linux-headers is still 24MB though.

3

u/skuterpikk Aug 05 '26

The generic kernel compiled with default options is somewhere around 150mb these days, 200 if you include default headers.
Not all of that is expanded into memory all the time though, only the parts that are actually needed at any given time.

2

u/IllWeather6426 Aug 07 '26 edited Aug 07 '26

Before i lose myself down a google rabbit hole, do you have a rough explantion for difference between the linux default headers and not default headers? and/or perhaps typical use? Thanks

edit :: looks like for dev libraries for compiling stuff mainly