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 09-16-2008, 11:30 PM   #1
kernel99
LQ Newbie
 
Registered: Nov 2003
Posts: 24

Rep: Reputation: 1
compiling kernel help needed pls.


hi,
i'm trying to compile new kernel and found some resources online but got confuse.

procedure i followed:
1. downloaded tar source file from online
2. copy and extract to /usr/src/linux directory
3. ln -s linux-2.... linux
4. cd linux
5. some resources i saw to copy ./config which i couldn't find
6. when i ran make oldconfig ----i've to click on yes or new many times.

7. make
8. make modules_install
9. make install
10. vi /boot/grub/grub.conf and change default 1 to 0.

i'm really confused in number 5 and 6. as what i've to follow after i untar the file into /usr/src/linux directory. until step number 7.

i could do it successfully but in number 6 i've to keep on pressing yes or new for each module..

if you can clarify for me would be really appreciated.

thanks much.
regards,
kernel99
 
Old 09-16-2008, 11:45 PM   #2
henry_shadowjet
Member
 
Registered: Oct 2006
Posts: 55

Rep: Reputation: 15
Hi there,

I am running Fedora 9.

To compile kernel, usually I use the following steps (as normal user):
- Download kernel.tar.bz2
- extract on /tmp (issue command: tar -xjvf /path/to/kernel.tar.bz2)
- cd kernel
- make mrproper
- copy .config file from earlier kernel, if you don't have one, try to download the kernel-devel package file, it should be in there.
- make oldconfig (as you know, you may need to answer a few questions here)
- make clean
- make bzImage
- make modules

Now the following steps would be done as root:
- su (then type root password)
- cd /usr/src/kernels
- mv /tmp/kernel .
- cd kernel
- make modules_install
- cd /boot
- (assuming version 2.6.26.5) mkinitrd initrd-2.6.26.5.img 2.6.26.5
- cp /usr/src/kernels/kernel/arch/x86/boot/bzImage ./bzImage-2.6.26.5
- cp /usr/src/kernels/kernel/System.map ./System.map-2.6.26.5
- cd grub
- nano grub.conf (and make changes as necessary to boot 2.6.26.5)

VOILA! You're done!
 
Old 09-17-2008, 12:05 AM   #3
kernel99
LQ Newbie
 
Registered: Nov 2003
Posts: 24

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by henry_shadowjet View Post
Hi there,

I am running Fedora 9.

To compile kernel, usually I use the following steps (as normal user):
- Download kernel.tar.bz2
- extract on /tmp (issue command: tar -xjvf /path/to/kernel.tar.bz2)
- cd kernel
- make mrproper
- copy .config file from earlier kernel, if you don't have one, try to download the kernel-devel package file, it should be in there.
- make oldconfig (as you know, you may need to answer a few questions here)
- make clean
- make bzImage
- make modules

Now the following steps would be done as root:
- su (then type root password)
- cd /usr/src/kernels
- mv /tmp/kernel .
- cd kernel
- make modules_install
- cd /boot
- (assuming version 2.6.26.5) mkinitrd initrd-2.6.26.5.img 2.6.26.5
- cp /usr/src/kernels/kernel/arch/x86/boot/bzImage ./bzImage-2.6.26.5
- cp /usr/src/kernels/kernel/System.map ./System.map-2.6.26.5
- cd grub
- nano grub.conf (and make changes as necessary to boot 2.6.26.5)

VOILA! You're done!
thanks for the details and thanks much.
yes in CentOS i didn't have to do make bzImage and - cp /usr/src/kernels/kernel/arch/x86/boot/bzImage ./bzImage-2.6.26.5
since make install does all the necessary new kernel vmlinuz and system map into /boot.
but
where do we copy .config file to....
i found mine now in /usr/src/kernels/..
does it contain all the old config informations?
what is the purpose of make oldconfig?
would be glad to hear.
thanks
 
Old 09-17-2008, 12:22 AM   #4
henry_shadowjet
Member
 
Registered: Oct 2006
Posts: 55

Rep: Reputation: 15
Well, .config contains your kernel configurations. That's all it is. I would say that the one you find on /usr/src/kernels is indeed your old config.

The purpose of "make oldconfig" is to read the existing ".config" file and insert parameters according to your old settings (previous kernel and the like). And if it has a few features (new features usually) that is not already defined by the .config file, then it asks you.

If you don't have .config, you can issue "make config" and it will create a .config for you depending on what you choose for each question. But that is cumbersome, you might want to use "make menuconfig" instead, cuz it shows menus and make your life much easier.

Anyway to avoid much pain and wrong configurations, usually I start off with the old .config file and work from there.

Good luck then.
 
Old 09-17-2008, 12:34 AM   #5
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Umm,

'zcat /proc/config.gz > .config'

will copy the config of your currently running kernel into .config

then 'make menu_config' and compile

Last edited by johnson_steve; 09-17-2008 at 12:38 AM.
 
  


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
needed help in finding a book ,pls assist wrapster Solaris / OpenSolaris 4 07-05-2008 10:53 AM
why is this cp script not working properly?, help needed, pls!! wrapster Solaris / OpenSolaris 8 05-26-2008 03:47 AM
network PROBLEM left compiling kernel 2.6.15.4--help needed! oser Fedora 1 02-24-2006 02:40 AM
Help needed for compiling the kernel JIV Linux - Software 1 02-14-2004 02:15 AM
help needed compiling kernel schatoor Linux - Software 2 11-28-2002 01:44 PM


All times are GMT -5. The time now is 07:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration