LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 02-03-2008, 10:06 PM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Unhappy compile a new kernel in RHEL 5


Hi all,

I need some help in compiling a new kernel. I am using RHEL 5 with kernel version 2.6.18.

I have downloaded a kernel from link [HTML]http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.6.tar.bz2[/HTML]

Code:
1. cd /usr/src
2. wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2
3. tar xvfj linux-2.6.20.tar.bz2
4. cd linux-2.6.20
5. make clean && make mrproper
6. make menuconfig
7  make clean
8. make bzImage
9. make modules
10. make modules_install
11. mkinitrd /boot/initrd-2.6.20.img 2.6.20 
I am following this article [HTML]http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-6[/HTML]

I have completed these steps (till 10) with no errors, BUT when I am trying the 11 th step, no new kernel img file is found.
It only has the old file i.e initrd-2.6.18.img.

Also, few parameters in the make menuconfig are bit confusing, it would be really great if someone has any ebook regarding the parameters.

Pls help !!

Thanks in Adv.
Vikas
 
Old 02-04-2008, 05:54 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Well you been reading old information, the steps in order are;

make mrproper
make oldconfig (this will get you very close to a working kernel as supplied by Red Hat)
make menuconfig (or config or xconfig);this is where one can tweak the configuration
make
make modules_install
make install

Sorry, no ebook but one can download the 'Linux kernel in a netshell" here (direct link);

http://www.kernel.org/pub/linux/kern...a_nutshell.pdf
 
Old 02-05-2008, 10:11 PM   #3
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Hi Lenard,

THANKS A TON.

your steps really helped me.

Regards,
Vikas
 
Old 02-06-2008, 06:13 AM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Your welcome, glad to help.

FYI: they are not my steps they all come from reading "The Linux kernel in a nutshell"
 
Old 02-06-2008, 08:28 AM   #5
asutherlandus@yahoo.
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Problem building on amd64

I'm trying to build kernel 2.6.18-53.1.6.el5-x86_64

rhel5 on amd64.

I get the following error from make mrproper:

scripts/Makefile.clean:17: /usr/src/kernels/2.6.18-53.1.6.el5-x86_64/drivers/infiniband/hw/amso1100/Makefile: No such file or directory
make[3]: *** No rule to make target `/usr/src/kernels/2.6.18-53.1.6.el5-x86_64/drivers/infiniband/hw/amso1100/Makefile'. Stop.
make[2]: *** [drivers/infiniband/hw/amso1100] Error 2
make[1]: *** [drivers/infiniband] Error 2
make: *** [_clean_drivers] Error 2

I removed and reinstalled the kernel src and still get the same error.

thanks for your sugestions,
Andrew
 
Old 02-06-2008, 09:16 AM   #6
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Why???? Are you sure you don't really just need to install the kernel-devel rpm package??

Maybe something like: yum install kernel-devel

You do know that one needs to prep the kernel source when installed from the Red Hat supplied source rpm file??

From the /usr/src/redhat/SPECS directory: rpmbuild -bp --target=`uname -m` kernel-2.6.spec

FYI: tagging on to a pretty much closed thread is considered rude by some, vikas027 did state that he/she was helped.
 
Old 02-06-2008, 12:51 PM   #7
asutherlandus@yahoo.
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Sorry for the lapse in etiquette.

I'll go read Linux kernel in a netshell, and post a new thread if need be.

Andrew
 
Old 02-06-2008, 02:12 PM   #8
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
This is no biggie to me, I just letting you know for the future.

I asked why because in many cases one does not need to re-build or build the kernel from the src.rpm file as supplied from Red Hat. This may be of interest to you;

http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
http://wiki.centos.org/HowTos/Custom_Kernel
http://wiki.centos.org/HowTos/BuildingKernelModules
 
Old 09-18-2008, 12:42 AM   #9
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Smile These are my notes, may be it can help you out.

Quote:
Originally Posted by asutherlandus@yahoo. View Post
I'm trying to build kernel 2.6.18-53.1.6.el5-x86_64

rhel5 on amd64.

I get the following error from make mrproper:

scripts/Makefile.clean:17: /usr/src/kernels/2.6.18-53.1.6.el5-x86_64/drivers/infiniband/hw/amso1100/Makefile: No such file or directory
make[3]: *** No rule to make target `/usr/src/kernels/2.6.18-53.1.6.el5-x86_64/drivers/infiniband/hw/amso1100/Makefile'. Stop.
make[2]: *** [drivers/infiniband/hw/amso1100] Error 2
make[1]: *** [drivers/infiniband] Error 2
make: *** [_clean_drivers] Error 2

I removed and reinstalled the kernel src and still get the same error.

thanks for your sugestions,
Andrew


http://voidmain.is-a-geek.net/redhat...nel_build.html
http://www.howtoforge.com/kernel_compilation_suse
http://www.digitalhermit.com/linux/K...FIGURATION-2-6

First install these two packages, I prefer yum
Code:
yum install ncurses-devel
yum groupinstall "Java Development"
Code:
1. cd /usr/src
2. wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2
3. tar xvfj linux-2.6.20.tar.bz2
4. cd linux-2.6.20
5. make clean && make mrproper
6. make oldconfig (this will get you very close to a working kernel as supplied by Red Hat)
7. make menuconfig (or config or xconfig);this is where one can tweak the configuration
8. make
9. make modules_install
10. make install
11. mkinitrd /boot/initrd-2.6.20.img 2.6.20 
12. cp .config /boot/config-2.6.20
13. cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.20
14. cp System.map /boot/System.map-2.6.20
15. ln -s /boot/System.map-KERNEL_VERSION /boot/System.map

These steps worked fine for me.

I am not an expert, but this brought two kernel options for me in the GRUB menu. May be you can get an idea from this.

Regards,
vIKAS
 
Old 10-11-2008, 02:27 PM   #10
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Lenard View Post
Well you been reading old information, the steps in order are;

make mrproper
make oldconfig (this will get you very close to a working kernel as supplied by Red Hat)
make menuconfig (or config or xconfig);this is where one can tweak the configuration
make
make modules_install
make install

Sorry, no ebook but one can download the 'Linux kernel in a netshell" here (direct link);

http://www.kernel.org/pub/linux/kern...a_nutshell.pdf
the link is forbidden,how to get that book ??
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
How to compile kernel in RHEL versions kiranbyk Linux - Kernel 6 01-02-2008 07:44 AM
How can I compile software on RHEL ? calande Red Hat 6 07-31-2006 07:23 AM
Compile Failure RHEL 4.0 U3 wnevis Linux - Software 1 03-14-2006 09:49 PM
Looking for RHEL 4 with 2.6.9-11 kernel bigdumbchimp Red Hat 1 01-17-2006 04:09 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:00 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