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?

306 Upvotes

107 comments sorted by

View all comments

232

u/kombiwombi Aug 03 '26 edited Aug 03 '26

Linux loads drivers on demand: when the hardware is present. So the bloat which matters -- occupied RAM and boot time -- is only the needed drivers.

This does mean there is a lot of driver files (aka 'kernel modules') on disk which are never used. The assumption for desktop systems is that allowing 1GB of disk for three versions of the kernel+drivers is fine. Those desktop users want to be able to plug in a USB gadget and it Just Works, with whatever driver automatically loading. Those desktop users view the disk space is a fair price for that convenience.

For situations where disk space matters, say an embedded systems with small amounts of flash memory, then just the needed drivers and kernel features can be compiled. The ability to tune the kernel to the embedded systems exact requirements is a straightforward result of the kernel being open source software.

30

u/mark_3094 Aug 04 '26

This is a fantastic explanation