On 30.06.2015, stan wrote:
That's the hard part of compiling a custom kernel; eliminating all the irrelevant modules and functionality. I've looked, and there doesn't seem to be a program that scans the system, and only turns on hardware modules for the system scanned.
"make localmodconfig" is what you're after. Be aware that localmodconfig does exactly what you want. So if you e.g. don't have connected a device containing an ext4 filesystem at the moment you issue the command, ext4 support won't be in your new kernel.