LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 10-20-2003, 08:43 PM   #1
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
Newbie Kernel re-compile disaster


I tried getting Kernel 2.4.22 source onto Red Hat 9 but I seemed to have wrecked the system completely. The Kernel HOWTO needs a rewrite I think... obviously it's still not idiot proof.

I went and unpacked the source into the /usr/src directory. I then went and make the kernel according to instructions. Went and made a bzImage and copied it to /boot, and then adjusted grub so that it would boot.
Also I had to copy kernel .config files... but with the RedHat kernel, I couldn't find these anywhere. So I just ignored them hoping the new kernel would reconfigure itself.

Also, I noticed that a initrd file needed to be set in GRUB, but I have no idea how to go about making such a file. The HOWTO wanted me to copy a "linuxrc" file into a directory, but a search of the system didn't find me one of these files anywhere.... so I just kept the initrd from the old kernel.

When I tried booting in, the kernal just hung.... it got stuck somwhere around the agp...something-or-other section... but with no error message.
So then I tried booting back into the 2.4.20-22 kernel again, only to have the kernel panic, complete with flashing keyboard lights.

How do you make the initrd file anyway?
Also, when I started xconfig for selecting what goes into the kernel... does it select appropriate modules by default?

cheers,

 
Old 10-20-2003, 11:32 PM   #2
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
I can probably answer a few of your questions. I am no kernel expert, but i have managed the last 10 (or so) attempts successfully.

I don't use grub either. But, when I do a kernel compile I rename the original kernel to something like vmlinux.old (same with System.map) and change the appropriate lines in LILO so that I have an extra boot choice to get to the old kernel just in case. I do this before I even begin. Then, I use make menuconfig because its a little easier to get through all the kernel options IMHO. It includes an option to load a config file, which might be the thing to do since, no: a new kernel will not select appropriate modules by default. You can choose to load your old config which prob works ok, and go through and eliminate everything you know you don't need, and add the things you do. The config file you would copy to boot should be located in the /usr/src/ directory that you compiled the kernel in.

I am not real sure about your other questions. Never had to deal with making initrd in Slackware.

A few commands you might like to know, that will help you find things are $whereis "file" (no quotes), $locate "file" (might have to do updatedb first as root), and: $find.

If you don't know of the exact name, you can use something like $whereis afile* and it will find anything starting with afile. You could use it like: $locate *.jpg and it would find all jpgs on your system. Get the idea?

Good luck!

Last edited by Scruff; 10-20-2003 at 11:33 PM.
 
Old 10-20-2003, 11:57 PM   #3
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
OK, here's my second attempt... (currently doing the make bzImage rounds)

OK... it appears my kernal configs were screwed up from last time, hence the crash. Some important modules got skipped on config it seems...
Found the config files for Red Hat 9 (hidden away on it's own directory). I had no idea that those config files had anything to do with how the kernal gets configured *slaps head* so I loaded the old configs I found into the xconfig setup. Seems there's a lot of stuff in there. I had to change the processor type to PIII as well, plus I ripped out some of the USB, ISDN, Sound, Ham-Radio modules as I won't need them. BTW, this PC is a server with SCSI HDs only... and the SCSI drivers are treated as modules in the kernal. Hope this works..................

About this initrd file.... in GRUB, I'm wondering if I can skip it alltogether? I'm hoping.........

Since I have 3 SCSI hard disks that need starting on boot up, I wonder how one writed the linuxrc file?
 
Old 10-21-2003, 12:04 AM   #4
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
Sounds like your on the right track

/etc/fstab is where you can find/edit your disk mount options.
 
Old 10-21-2003, 08:31 AM   #5
lupin_the_3rd
Member
 
Registered: Oct 2003
Location: Memphis, TN
Distribution: Slackware current
Posts: 485

Rep: Reputation: 30
You don't need the initrd... just make sure grub is pointing to your root partition and not /=LABEL.... you could also copy your old kernel config (since you know it works) from /boot to /usr/src/linux-2.4.22/... and use it as a starting point.
 
Old 10-23-2003, 12:52 AM   #6
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
Solved it... after many hours of frustration.

All my problems were in the kernel configuration.

First, I started off modularising most of the bits of the kernel... AGP, SCSI etc.

Screwed up another kernel reboot when I forgot to add ext3 support! so I built that in to the kernel.
Then I used mkinitrd command to make the initrd file.

One thing the whole experience tells me, is that you REALLY need to know your hardware when you rebuild kernels. One little mishap in kernel compilation with a missing part or module.... and your system does a kernel panic with lots of crytic errors which take you ages to decrypt.
 
Old 10-23-2003, 01:38 AM   #7
zLinuxz
Senior Member
 
Registered: Feb 2002
Location: Shanghai, CHINA
Distribution: RH 5.0,5.1 6.0,6.1 7.0,7.1,7.2,7.3.,8.0,9.0, RH Enterprise, Fedora C1, C2
Posts: 1,216

Rep: Reputation: 45
something that Linux teaches any person who is serious about learning Linux, is that it develops a deep appreciation and understanding for your machine and how it works. And that is one of the millions of reasons why I love Linux,
Glad to hear that you learnt how to compile your kernel!!!

I still remember how that felt when I first understood and learnt how to do it as well. I used to be so afraid of simply hearing "you need to recompile your kernel", hehe, that used to be death to me. But now I just love recompiling my kernel all the time, hehhe.

cheers!

zLinuxz
 
Old 10-23-2003, 02:52 AM   #8
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
Yeah, I learnt a lot alright... after recompiling the kernal at least ten times over two days, I can now do 'nohup make bzImage &' in my sleep.

Also learnt which modules do what, and how I can toy with specific details of the system. By leaving out the odd driver somewhere, a Windows CD ends up with short filenames, and a missing file system means the system won't boot at all! And I had no idea that the APM had anything to do which sync-ing the hardware clock.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
another newbie with Kernel compile problems tinyredpea Linux - General 7 10-10-2004 06:20 PM
compile kernel help for newbie gazza Linux - Software 0 07-07-2004 06:37 PM
Newbie kernel compile error Reefcrazed Linux - Newbie 3 05-07-2004 07:35 AM
Newbie kernel compile problem seanro Slackware 5 02-06-2004 11:04 AM
newbie wants to compile new kernel taoweijia Linux - Newbie 2 01-30-2004 12:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:21 AM.

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