On Tue, 30 Jun 2015 11:20:36 -0600 Chris Murphy lists@colorremedies.com wrote:
On Tue, Jun 30, 2015 at 8:24 AM, Heinz Diehl htd+ml@fritha.org wrote:
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.
Does localmodconfig set drivers to n such that they aren't even compiled? Or are they m such that they are modules that are only loaded on demand? I'm going to guess the answer is n, the point of which is it saves a ton of compile time, not so much creating a lean kernel (as anything not needed wouldn't be loaded anyway). Correct?
I just compiled a kernel using localmodconfig, and you are exactly right. It set all the modules I didn't need to n, and the kernel compiled a lot more quickly than usual. The size of the kernel was just slightly smaller than previously. It used the configuration of the running kernel as a starting point, so I didn't lose all the other customization I had implemented over the iterations. I'm just about to boot into the new kernel, so the proof of the pudding will soon be apparent. If it boots, as it should, I'll be pleased with this way of building kernels.