LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to safely reduce kernel compile time? (https://www.linuxquestions.org/questions/linux-general-1/how-to-safely-reduce-kernel-compile-time-374804/)

rollo 10-19-2005 04:13 PM

How to safely reduce kernel compile time?
 
I'm about to compile a new kernel and I'm already dreading the time it's going to take to make the bzImage file.

Yep, I'm running an ancient and slow laptop, I know. However, I've seen figures of 15 minutes quoted for compiling a kernel on a 500mhz machine. Is it normal that compiling a default version of kernel 2.6.12.3 took 4 hours 20 minutes with my 300mhz?

What options could I look to turn off safely at the config stage?

oneandoneis2 10-19-2005 04:34 PM

If by "a default version" you mean a kernel with almost all the options set to "Yes" - then yep, I'd expect a long compile time.

Really, the best thing to do to whittle this down is to start with an empty config, and only say "Yes" to the things you're sure you need. It might take trial and error, but you'll get a much smaller kernel out of it.

A simple way to get a head start is to check what modules are currently running, and assume you need all of them built into your kernel ;)

Tinkster 10-19-2005 04:50 PM

Also, bear in mind that subsequent recompiles (with
only minor changes to the config) will be significantly
faster.


Cheers,
Tink

rollo 10-21-2005 01:11 PM

Thanks for those tips you two.

Quite honestly, I don't think I am up to doing an "opt-in" compile. I would be certain to miss some obscure but vital function ("kernel support for ELF binaries", anyone?) and find myself back at the beginning.

Would it not be safer to do a "make oldconfig" and do some serious weeding of obviously irrelevant hardware modules, for example? I definitely don't use ISDN or Memory Technology Devices or legacy CD-ROMs, so that would be three branches of the tree safely gone, right?

Is there anywhere in particular that the "meat" - ie, a lot of data - is concentrated in the kernel tree?

oneandoneis2 10-21-2005 01:19 PM

Either way runs the risk of removing something you shouldn't. Just keep a copy of your current kernel available, and if you foul up, it doesn't matter - just use your safe kernel, and have another go! You'll get there in the end.

I did.

PMorph 10-21-2005 02:03 PM

It might help to first compile the "probably not needed" parts as loadable modules (if that option is given).
If then all your hardware is working ok with the new kernel, you can basically disable all the modules that are not listed with the "lsmod" command.


All times are GMT -5. The time now is 07:54 PM.