LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   compile a new kernel in RHEL 5 (https://www.linuxquestions.org/questions/linux-enterprise-47/compile-a-new-kernel-in-rhel-5-a-618474/)

vikas027 02-03-2008 10:06 PM

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

Lenard 02-04-2008 05:54 AM

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

vikas027 02-05-2008 10:11 PM

Hi Lenard,

THANKS A TON.

your steps really helped me.

Regards,
Vikas

Lenard 02-06-2008 06:13 AM

Your welcome, glad to help.

FYI: they are not my steps they all come from reading "The Linux kernel in a nutshell"

asutherlandus@yahoo. 02-06-2008 08:28 AM

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

Lenard 02-06-2008 09:16 AM

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.

asutherlandus@yahoo. 02-06-2008 12:51 PM

Sorry for the lapse in etiquette.

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

Andrew

Lenard 02-06-2008 02:12 PM

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

vikas027 09-18-2008 12:42 AM

These are my notes, may be it can help you out.
 
Quote:

Originally Posted by asutherlandus@yahoo. (Post 3047962)
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

divyashree 10-11-2008 02:27 PM

Quote:

Originally Posted by Lenard (Post 3045458)
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 ??


All times are GMT -5. The time now is 05:11 PM.