LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-11-2005, 12:22 AM   #1
dannyk1
Member
 
Registered: Aug 2004
Location: Geelong, Vic Australia
Distribution: Gentoo, Ubuntu,and sometimes something from billy gates (when Im desperate)
Posts: 179

Rep: Reputation: 31
cannot make a custom kernel work


I have been trying for a few days now to compile a custom kernel but can never get the new one to boot.

On a system running FC3, and after reading plenty of contradicting howto's I have tried about 8 times now but getting nowhere.

When I run make xconfig and load the file config-2.6.9-1.667smp from the /boot dir, even when I make no changes, or just a few like including ex3 support I get
kernel panic cannot find root file system

My understanding is that the config-2.6.9-1.667smp file should be what fedora uses for this system so it should be the same as the standard kernel. So why is it when I look at this config it doesn't even have ex3 support included in the kernel?

Any hints on how to make a working kernel would be great..

ps ..
My grub conf is

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz

title Fedora Core (2.6.9-1.667smp)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667smp ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.9-1.667smp.img
title Fedora Core-up (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.9-1.667.img


title Custom Kernel 2.6.11
root (hd0,0)
kernel /vmlinuz-2.6.11 ro root=LABEL=/
 
Old 06-11-2005, 04:59 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
(Painful isn't it - it's a rite of passage.)

OK - you havn't pointed GRUB to the new initial ram-disk. (That's the initrd line in the original GRUB.conf) ... you need this to access the root filesystem in GRUB

see "man mkinitrd" .

(Did you copy a file called vmlinuz-2.6.11 into /boot? Just checking.)

Congratulations - after this you will be halfway to guru-hood

[begin general discussion]
I know what you mean about the conflicting instructions out there. I do not know where these guys are coming from - they seem pretty genuine - but their instructions never work by themselves. Occasionally there is a clear HOWTO ... but usually specific to a particular architecture which is never yours.

I discovered, from many sets, that the procedure is actually quite simple - provided you are not trying to be fancy or use weird configurations (i.e. Grub is in MBR and root is in an IDE drive, there is a separate boot partition ... etc).

You've done it -

make xconfig
(painstakingly pick through the options - and save to a file before you finish)
(this is the hardest part ... it will need to be repeated several times before you get it right. Even then, monts down the track you'll try to run something and find out that you forgot to compile the module.)
... then something like ...

make (could be "make install")
make modules
make modules install

copy (or move) the kernel image into /boot (It's often right at the bottom of the source tree.)
mkinitrd <new version>

edit grub.conf
copy the old entry to a new location
change the title name
change version numbers to correspond to the kernel image and the initial ramdisk

This sound familiar?
(If you did anything different, say so, and it'll help other folk following in your footsteps.)

BTW: if you miss a module in xconfig - you can rerun xconfig, then do make modules - make modules install again without needing to recompile the kernel. The only time you have to recompile the entire kernel is if the "m" option is not available (or this dosn't work ...)

Now I had to dig all this out of about a dozen locations and over 30 A4 pages of 8-point text.


Last edited by Simon Bridge; 06-11-2005 at 05:19 AM.
 
Old 06-11-2005, 08:22 PM   #3
dannyk1
Member
 
Registered: Aug 2004
Location: Geelong, Vic Australia
Distribution: Gentoo, Ubuntu,and sometimes something from billy gates (when Im desperate)
Posts: 179

Original Poster
Rep: Reputation: 31
Thanks for the response.

I copied the existing initrd from the old kernel and finally got it to boot!

Do I need to make a new one to suit my kernel?

Its strange that of all the Howtos I have read, not one has mentioned the ramdisk bit.. Or how to make one.

ps ..

More importantly, when do I achieve guru-hood
(Just kidding).
 
Old 06-11-2005, 08:40 PM   #4
cedar
Member
 
Registered: Feb 2004
Location: Colorado Springs, CO
Distribution: Ubuntu, Fedora, PCLinux, MEPIS, still miss Libranet
Posts: 162

Rep: Reputation: 30
if you add make install after make modules_install it automatically adds an entry in grub for the new kernel and copies the kernel image to /boot

can't say anything about initial ramdisk as I've never used it in a custom kernel

one more step to guru-hood

Last edited by cedar; 06-11-2005 at 08:42 PM.
 
Old 06-12-2005, 05:01 AM   #5
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
cedar: you're using LILO or you do not use a boot partition? (see man mkinitrd for details of why it is needed.)

dannyk1: I'd have said you'll want a new one to suite your kernel - avoids possible trouble later. It's purpose is to load a minimum driver set for GRUB to reach your root partition and generlly check things out. The newer kernel will have better drivers - that's all. As you've figured out, you don't need the latest drivers to get things going, and when the new kernel image has booted, the initrd drivers are no longer loaded anyway.

Well done.
The rest is experience ... you've just taken a big step ... and reputation.
Next project - set up a LAN.
But first - you deserve a stiff drink.
 
Old 06-12-2005, 07:20 AM   #6
cedar
Member
 
Registered: Feb 2004
Location: Colorado Springs, CO
Distribution: Ubuntu, Fedora, PCLinux, MEPIS, still miss Libranet
Posts: 162

Rep: Reputation: 30
I use grub, but not a separate boot partition. That would explain why I never needed it before.
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When to make custom kernel trnsfrmrsr Linux - Hardware 1 10-05-2005 03:40 PM
getting sound modules to work on a Thinkpad T20 with a custom 2.6.10 kernel donkeygod Debian 2 03-23-2005 10:04 AM
how to make modifications to a custom kernel build? h/w Linux - Newbie 2 11-09-2003 03:47 PM
How do I make sure Im booting onto my custom kernel? Kramer Linux - General 10 10-21-2003 12:43 PM
can't make custom prompt work for root!? jaregi Linux - General 4 09-09-2003 11:40 PM


All times are GMT -5. The time now is 02:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration