Automatically build a slim kernel

Atomic desktops are cool, but a huge monolithic kernel is not.

I just began building my own kernel

  • F39 Distrobox, dependencies, kernel-devel
  • so building from the fedora kernel source, but with own configs

I have 3 goals

  • remove bloat. There are soooo many drivers for devices that I will literally never use. TVs, cameras, non-usb accessories, AMD+Nouveau (while I am on Intel), …
  • harden a bit. The presets seem very reasonable, but not always focused on security. I think I also found an error (a patch only necessary for glibc 2.3.3)
  • build with x86_64-v4 compiler optimitations

So after clicking through menuconfig for hours…

Is there an option to autodetect hardware and support that? Like, plug in all your devices, detect, and remove all the other drivers?

I think this is crucial for slim and optimized kernels, that do what you need.

Thanks!