LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2005, 04:13 PM   #1
rollo
Member
 
Registered: Apr 2004
Location: France
Distribution: Debian Sid (Kanotix)
Posts: 237

Rep: Reputation: 30
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?
 
Old 10-19-2005, 04:34 PM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
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
 
Old 10-19-2005, 04:50 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 10-21-2005, 01:11 PM   #4
rollo
Member
 
Registered: Apr 2004
Location: France
Distribution: Debian Sid (Kanotix)
Posts: 237

Original Poster
Rep: Reputation: 30
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?
 
Old 10-21-2005, 01:19 PM   #5
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
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.
 
Old 10-21-2005, 02:03 PM   #6
PMorph
Member
 
Registered: Sep 2003
Distribution: Debian
Posts: 213

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel compile time and boot time lordofring Programming 1 11-13-2005 02:04 AM
howto reduce boot time? provkitir Debian 5 11-04-2004 02:29 AM
want to reduce system boot / init time 964racer Linux - Laptop and Netbook 7 06-09-2004 03:11 AM
First time Kernel compile - Problem. the_rydster Slackware 11 02-27-2004 04:48 AM
First-time kernel compile woes... redkazan Slackware 6 01-09-2004 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration