LinuxQuestions.org
Visit Jeremy's Blog.
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 12-28-2004, 08:05 PM   #1
niteshg
LQ Newbie
 
Registered: Nov 2004
Location: NJ
Posts: 29

Rep: Reputation: 15
recompile kernel


Hi,
I have a fedora core 2 distribtion with 2 kerrnels 2.6.5 and 2.6.9
I want to configure kernel 2.4.x on it since some appllication I want to run needs it.
How can I compile and build the kernel.

I tried the usual way of
make xconfig
make clean
make dep
make bzImage
tille here the process is normal .the trouble i guess starts from here.
make modules
make modulles_install
but when i run make modules it gives all the output on the screen like any othe 2.4.x kernel but the output here says that no need to do anything for eahc module

and the when i run make modules_install
the last line of the output is
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.24-28; fi
It does not give any error though.

I thiink the building is not done properly.However I tried to do all the ususal formalities of updating grub.conf.

But when i reboot into the 2.4.x kernel it gives me an error saying
kmod failed to exec /sbin/modprobe -s -k scsi_hostadapter , err no =2
kernel panic to mount root on fs

thanks,
Nitesh
 
Old 12-28-2004, 09:51 PM   #2
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Rep: Reputation: 19
Quote:
the last line of the output is
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.24-28; fi
That's correct, that usually means it worked.

Quote:
But when i reboot into the 2.4.x kernel it gives me an error saying
kmod failed to exec /sbin/modprobe -s -k scsi_hostadapter , err no =2
kernel panic to mount root on fs
Did you remember to make a new initrd? (If your kernel doesn't have the drivers it needs in order to talk to your hard disk compiled into it, then it needs those drivers placed in an "initial ramdisk" or initrd. man mkinitrd.)

Moy
 
Old 12-28-2004, 10:18 PM   #3
niteshg
LQ Newbie
 
Registered: Nov 2004
Location: NJ
Posts: 29

Original Poster
Rep: Reputation: 15
Hey Moy,
Thanks for a prompt reply
I did run
mkinitrd /boot/initrd-2.4.24-28.img 2.4.24-28

cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.24-28
cp System.map /boot/System.map-2.4.24-28
$ ln -s /boot/System.map-2.4.24-28 /boot/System.map

made the changesin grub.conf.
Everything looks fine but the loading of scsi_hostadapter error i get during boot.I think its got something to do with loading of modules

Nitesh
 
Old 12-29-2004, 01:24 AM   #4
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Rep: Reputation: 19
From the mkinitrd man page:
Code:
       mkinitrd automatically loads [...]
       all scsi_hostadapter entries in /etc/modprobe.conf,
Since you had a question earlier about a 2.6 kernel, I assume you're going from 2.6 down to 2.4, so you probably don't have a modules.conf. I'm guessing that's what the problem is.

I don't remember how to build a modules.conf, but perhaps this howto might help. If you can figure out which modules you need, you may not need the modules.conf since you're just trying to put them in the initrd---you can use the --with switch on mkinitrd instead. (Of course, you might possibly need a modules.conf later for some other modules your hardware needs but you can cross that bridge when you get to it.)

Also, since you're building this so specifically for a particular app on your particular machine, wouldn't it be easier to just compile all that stuff into the kernel instead of building it as modules?

HTH.

Last edited by Moy Easwaran; 12-29-2004 at 01:38 AM.
 
Old 12-29-2004, 10:47 AM   #5
niteshg
LQ Newbie
 
Registered: Nov 2004
Location: NJ
Posts: 29

Original Poster
Rep: Reputation: 15
Hi Moy,
This is on a different computer.I do have a modproe.conf file in my etc directory.

I have a working 2.6.5 and a 2.6.9 kernel installed on this computer.
the contents of modprobe.conf reads as follows:

alias eth0 via-rhine
alias snd-card-0 snd-via82xx
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-via82xx { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-via82xx
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd

I need to load modules.

I will give one more try to do everything again from scratch and let you know what happened. I will also try with compiling into the kernel.

Thanks,
Nitesh
 
Old 12-29-2004, 09:43 PM   #6
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Rep: Reputation: 19
Quote:
I do have a modproe.conf file in my etc directory.
Right. Sorry, I don't think I was clear: the 2.4 kernel uses a file called modules.conf, not modprobe.conf (which is a 2.6ism, although the two files should look almost or even exactly the same). I was guessing that you're missing a modules.conf.

Anyway, with those and the SCSI modules (either compiled in or added by way of modules.conf or mkinitrd --with), hopefully you're up and running by now.
 
Old 12-30-2004, 02:34 PM   #7
niteshg
LQ Newbie
 
Registered: Nov 2004
Location: NJ
Posts: 29

Original Poster
Rep: Reputation: 15
Hi Moy,
I got rid of the scsi devices support error by playing around with the config file.But now one more problem has started.

When i try to boot into the 2.4.24-28 kernel
the following is what i get when i try to boot

initrd /initrd-2.4.24-28.img
[Linux initrd@ 0xdfc3000 0x 1c....]
uncompressing Linux .. ok booting the kernel

xd : out of memory
kernel panic :unable to mount root fs 00:00

Thanks,
Nitesh
 
Old 01-01-2005, 07:36 PM   #8
Moy Easwaran
Member
 
Registered: Dec 2004
Distribution: Slackware, OpenBSD
Posts: 44

Rep: Reputation: 19
Wow, man, you're having all kinds of weird problems, aren't you? :-)

Googling suggests that xd is a driver for something (a USB flash card?) and might possibly have had issues in the past. I guess you could try leaving that out if you don't need it, and seeing how that works.

Other than that, I'm really running out of ideas, sorry.

Where did you get this kernel from?---ie. did you start from scratch or are you modifying some distribution's kernel? The safest kernel-building approach IMO is to start with the .config from some stable distro (Slackware is a good choice for this), add what you need, and then subtract incrementally (or I guess decrementally...).

Good luck.
 
Old 01-01-2005, 10:37 PM   #9
niteshg
LQ Newbie
 
Registered: Nov 2004
Location: NJ
Posts: 29

Original Poster
Rep: Reputation: 15
yeah man . I got this kernel from kernel.org man ( ftp.kernel.org )
I will try with some other kernel.I wanted to compile a 2.4.x kernel .Is slackware really trouble free in compilation?
I willr give it a try.
Thanks,
Nitesh
 
Old 01-02-2005, 12:25 AM   #10
Hiel Van Campen
LQ Newbie
 
Registered: Apr 2002
Location: San Diego Ca
Distribution: Gentoo
Posts: 2

Rep: Reputation: 0
Sounds like your ramdisk is to small. I dont use initrd but its a common prob for gentoo users who use it.The kernel line in grub.conf looks like this "kernel /bzIamge root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 ". You need to increase the size of your ramdisk probably in1024 chunks.
 
  


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
how to recompile kernel 2.4.21-15.EL zameer_india Linux - Newbie 2 12-24-2004 01:02 AM
kernel recompile error (kernel panic) tombaaaaa Linux - Newbie 4 08-04-2004 04:32 PM
Recompile kernel 2.6 heema Linux - General 3 05-26-2004 10:29 AM
9.2 kernel recompile dukeinlondon Mandriva 3 11-10-2003 06:34 AM
Recompile Kernel ? Amerist Linux - Newbie 5 04-16-2002 04:13 AM

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

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