LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2004, 03:58 PM   #1
ksun
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
Kernel compile - Please clarify


I have read a lot of threads and done a lot of googling to find a difinitive answer, but the more I read, the further I am confused.

Some methods say "Do 1, 2, 3, 4 ..." some say "Don't do 2, but do 1, 3, 4 ..." and I am mega-confused (and can't compile a kernel without errors, but that isn't what I want to address in this thread.

Will you all help me understand when and if you need to do each of these steps when doing a kernel compile. For the purposes of this thread, let's please just assume you are NOT doing a kernel upgrade, but perhaps something simple like adding NTFS as a module or something. I'm not really looking for best practices on whether to compile as a user or with root either.

(assuming you have been able to get the kernel sources to /usr/src/linux-2.x)

make mrproper (seems like you only have to do this once, ever)
Copy the .config file from /boot/config-xxx to your source dircetory
make oldconfig (seems like you only do this if you did above step)
make xconfig, gconfig, menuconfig take your pick
make dep (unnecessary in 2.6 kernel)
make clean
make
make bzImage
make modules
make modules_install
make install

Last edited by ksun; 12-06-2004 at 04:41 PM.
 
Old 12-06-2004, 05:56 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,569

Rep: Reputation: 171Reputation: 171
First it depends which kernel version you're compiling. For 2.4 it's different than in 2.6 (more things are automatic).

make mrproper (seems like you only have to do this once, ever) - I never do it and it still works

Copy the .config file from /boot/config-xxx to your source dircetory - OK
make oldconfig (seems like you only do this if you did above step) - nope. It's one of the veriants: oldconfig, xconfig and so on
make xconfig, gconfig, menuconfig take your pick
make dep (unnecessary in 2.6 kernel) - correct
make clean - if you have just unpacked your kernel, you don't need it. Use if you'd like to clean your previous compilation.
make - Yes, in 2.6 it's equal to make bzImage in 2.4, but don't use in 2.4
make bzImage - In 2.4, instaead of make
make modules - In 2.6 it's a part of 'make' if I remember correctly
make modules_install - Yes
make install - Be careful. It overwrites your current kernel. Use ONLY when you're sure your new compilation will work. If you're not sure, copy the kernel manually and add to bootloader menu, so you're able to boot both versions.
 
Old 12-06-2004, 06:28 PM   #3
ksun
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
So why is recompiling the kernel so darned complicated? Isn't there some solution for automating more of this process that would still allow you to make it fairly flexible?

I am not exactly a newbie, but not advanced enough to take this on yet, but it seems to me that you could write a script which would query the kernel version, look for the sources, bring up the xconfig or gconfig menu and save the changes, make the whole mess, ask to replace or install the new kernel next to the old one, and then update your boot loader based on the previous answer.

Why hasn't anyone done this? And included it in the kernel distribution?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB concepts clarify zillah Linux - Newbie 3 02-05-2005 04:29 PM
some questions to clarify dimsun Linux - Newbie 4 11-05-2004 10:28 PM
Clarify something about Fedora for me? purplecow Fedora 12 11-05-2004 06:36 PM
Just to clarify (scripting, bash) onewhoknows Linux - Newbie 2 05-21-2004 07:12 PM
help me clarify shanenin Linux - Software 1 11-06-2003 10:28 PM


All times are GMT -5. The time now is 09:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration