LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-03-2007, 10:15 AM   #1
cafetog
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
Compile kernel


I am facing my first kernel recompilation. The current version is RHEL 3 kernel 2.4.21-4 and I must compile it to 2.4.21-37. I found the kernel-source-2.4.21-37.0.1.EL.i386.rpm but I am not so sure about the way to migrate it; even I had found documentation, none discribes a similar recompilation (ex: 2.4.21-XX to 2.4.21-XX)

Can someone help me with some info?
 
Old 04-03-2007, 11:14 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
After you install the source rpm you should get the kernel source code under /usr/src/linux if I'm right. Head to that directory and you'll find (or should, if it's working) either README file or INSTALL file or both of them. Those files (in other projects than kernel, too) describe what you are or should be doing to configure, compile and install the thing, and because the instructions may vary between kernel versions I strongly recommend you follow the advices written there to do the job. Basically it's very easy, but make sure it's right by reading that/those files. They contain all, and more, information you need in the process, and if it seems difficult to read, then you may search for some help on the net -- but remember, advices written for older kernel compilations may not be exactly the same with newer versions (especially the make step).

Basically one runs one of these in the source directory (NOTE: if you want to spare your current configuration, read the files for information how to save it -- after these steps that configuration may be lost).
Code:
make oldconfig
to start off by taking the older kernel configuration as a base
Code:
make menuconfig
for a menu-driven configuration (I prefer this)
Code:
make xconfig
which I've never managed to run, actually, but I think the file tells you how to get a graphical configuration window if you're running X.
Now that you've started the configuration, do the changes you want and need, and make sure you've got everything in place to have a bootable kernel. Even if you think you're fine, do not remove any older kernels before, if even then, you've tested this new compiled kernel runs fine.

The next step is, I think, running make:
Code:
make
this step may vary depending on the kernel version; on older kernels it consisted of several steps, nowadays (or last time I tried) I only had to run one. Depending on your filesystem types and choices you may have to take additional steps to complete the stuff, but basically after this is done you'll have the kernel and map files under the source directory (or it's subdirs, it depends). Then you'll copy them to /boot and hope they work

Shortly said, read README and/or INSTALL, they are your friends.
 
Old 04-03-2007, 06:42 PM   #3
52cent
LQ Newbie
 
Registered: Apr 2007
Posts: 14

Rep: Reputation: 0
In my /usr/src directory there are 4 folders:
linux-headers-2.6.17-10 linux-headers-2.6.17-11
linux-headers-2.6.17-10-generic linux-headers-2.6.17-11-generic

Why do i have all these folders? I mean, what are the 10-version for? And what are the differents between the generic to the non-generic?

Anyway i checked all these folders and didnt see any README or INSTALL files...
And when i compile and install a newer version of the kernel all the configurations on my system are lost?

its just im new to linux and want to get some info about upgrading to a newer kernel version in case ill have to upgrade.
 
Old 04-08-2007, 09:01 PM   #4
cafetog
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Original Poster
Rep: Reputation: 0
New issue during migration

Hi there,

As you adviced me I read the README file which gave me many ideas about the proceedure. Googling I had some complements and advanced in the kernel migration. After running a make modules_install I had some errors regarding "no module mptbase found for kernel blah blah blah". I went to the modules.conf and deleted any line containing mptbase. I run again the modules_install, all fine, then the make install and rebooted the system. At least, at this point I got the prompt for selecting among the previous kernel 2.4.21-4 and the new one 2.4.21-37; obviously I picked the last one but now I have another error:

VFS: Cannot open root device "LABEL=/" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: unable to mount root fs on 00:00

I tried forcing the real partitions in the grub.conf instead of the 'LABEL=/' (/dev/hda1...hda3) but something similar to the error is displayed.

My grub.conf looks like:

root (hd0,0)
kernel /vmlinuz-2.4.21-37.0.1.ELcustom ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.21-37.0.1.ELcustom.img

and the same thing for my current kernel version:

root (hd0,0)
kernel /vmlinuz-2.4.21-4.EL ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.21-4.EL.img

My point is that whenever I restart the machine with the -4 kernel it works fine, but when booting it with the new -37.0.1 kernel I always get the same error message, even the system is trying to mount the root in the same point.

Any further ideas? Should I take this query into another forum? I've spent many time and I feel I am running out of options.

Thanks for your help!!!
 
  


Reply

Tags
fs, mount, root, vfs



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
Why can't I compile this kernel module? (kernel: 2.6.8-powerpc Debian sarge) Lannix Linux - Hardware 5 05-01-2007 12:29 PM
How to restore out-of-box kernel settings if my kernel compile fails? brgr88 Slackware 8 04-18-2006 06:51 AM
upgraded kernel, won't let me compile kernel once Suspend2 patches are applied microsoft/linux Linux - Laptop and Netbook 3 10-02-2005 02:37 PM
Kernel Problems. Howto Compile a new kernel from 4.2 with backwards compatibility ? ShoCkwave Linux - General 2 06-19-2004 06:02 AM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12: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
Open Source Consulting | Domain Registration