Link to home
Start Free TrialLog in
Avatar of tmireles
tmireles

asked on

Trying to run Fedora Core 3 with a 2.4.xx kernel

Hello Everyone,

I have a project at work that is trying to run Fedora Core 3.  However there is a catch to this because I need this machine to run the a 2.4.xx kernel.  I have tried installing the source and compiling the kernel in FC3 and when I try to boot into it I get a kernel panic.  I have tried upgrading it from RedHat 9 to FC3 but this upgrades my kernel as well with no option to run the old kernel as with previous upgrades did.  I have also tried updating the FC1 installation but have not been able to get that to work as well.

If anyone has any suggestions I would greatly appreciate it.  I have ghost images of RedHat 9, Fedora Core 1 -3 so trying something that will blow everything away and leave the machine dead is not a problem just a simple restore of the image and I am back in business.

If this is possible please give me some help.  I am not an expert on linux.  I have recompiled kernels and all that good stuff but the more details you can give on your suggestion the better for me.

Thanks for the help in advance.
Avatar of surya_prabhakar
surya_prabhakar

The main problem is the 2.4.x kernel series requires old modutils . Fedora core 3 will come with new module-init-tools,
Get the old modutils from redhat site and compile it to a seperate directory and update your path to that and then compile kernel 2.4.x series.

The main problem is - with the new mod-init-tools you cant create a initrd . with out that most certainly you kernel will panic .
If you have problem with compiling modutils seperately update me .

download the modutils from here

http://www.kernel.org/pub/linux/utils/kernel/modutils/v2.4/

remember while compilng modutils dont forget to give --prefix or else it will over write the current tools which will be more mess .

good luck .
surya.
ASKER CERTIFIED SOLUTION
Avatar of surya_prabhakar
surya_prabhakar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tmireles

ASKER

I will give it a try and get back with you.  Thanks for the help thus far.
Surya,

Once again I appreciate the help.  Here is what I get when I try and do a make modules_install

cd /lib/modules/2.4.29; \
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /depmod -ae -F System.map  2.4.29; fi
/bin/sh: /depmod: No such file or directory
make: *** [_modinst_post] Error 127
[root@localhost linux-2.4.29]#


This is the last part of the message.  I you need me to post the entire thing let me know.  Also got an error when trying to do the mkinitrd which was looking for depmod.old.  I have seen this error before and found a work around this by making a sim link to depmod.  Not sure if this is the correct way to approach this error but it did what I needed it to.

The computer complained about not being able to load apgpart and it hangs there for a minute or so and then I get the kernel panic.  Right now everything is set to rhgb quiet or something like that in grub which I can remove.  The question is what place would the kernel panic write to.  In other words is there a log file I can access to get this information posted to you.  The computer runs thru these things so fast that I cannot figure out what the failure is at or how to write it all down since it is scrolling fast.  If there is a log file let me know and I will paste the part that you want.

Thanks
Please follow exactly
old
DEPMOD = /sbin/depmod
new
DEPMOD = depmod

you have left a "/" in the depmod line in Makefile

we shud understand what we are trying to do .
first we are compiling the modutil into /usr/local/modutils . then we are add that path to our regular system path
 
once the modutils compilation is done chec whether you have the correctly in place by goin phtsically to that directory .
# ls /usr/local/modutils/sbin

here you shud fine one depmod which is the old one . we are  trying to use this . hence we are updating the system path in way that this depmod is the first one in the path .
latter do an initrd like this in the same windows where you updated the path .

if it still does not work give me the output of below commands

#ls /usr/local/modutils/sbin
#echo  $PATH


surya.

 
Sorry about that did not see that.  I fixed it to read DEPMOD = depmod.

I copied the last few lines before the error and also what you asked me to copy.


cd /lib/modules/2.4.29; \
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then depmod -ae -F System.map  2.4.29; fi
depmod: cannot read ELF header from /lib/modules/2.4.29/modules.alias
depmod: /lib/modules/2.4.29/modules.ccwmap is not an ELF file
depmod: /lib/modules/2.4.29/modules.inputmap is not an ELF file
depmod: cannot read ELF header from /lib/modules/2.4.29/modules.symbols
make: *** [_modinst_post] Error 1

[root@localhost linux-2.4.29]# ls /usr/local/modutils/sbin/
depmod    insmod                 kallsyms       ksyms  modinfo   rmmod
genksyms  insmod_ksymoops_clean  kernelversion  lsmod  modprobe

[root@localhost linux-2.4.29]# echo $PATH
/usr/local/modutils/sbin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@localhost linux-2.4.29]#
Can u do kernel compilation from scratch and update me .

#mv /lib/modules/2.4.29 /tmp
# cd /usr/src/linux-2.4.29
open the Makefile and check the release name
4th line
EXTRAVERSION =  < leave it blank>

# cp .config config
# make mrproper
# cp config .config
# make oldconfig
#make dep
#make clean
# make bzImage
#make modules
#make modules_install

and then
# mkinitrd /boo/initrd-2.4.29.img 2.4.29

surya.
make sure the path is same before you do all this
/usr/local/modutils/sbin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
this is the error I get when I try and do the first line

[root@localhost linux-2.4.29]# mv /lib/modules/linux-2.4.29/tmp
mv: missing file argument
Try `mv --help' for more information.
[root@localhost linux-2.4.29]#
sorry I see my error
same error

[root@localhost linux-2.4.29]# mv /lib/modules/2.4.29/tmp
mv: missing file argument
Try `mv --help' for more information.
[root@localhost linux-2.4.29]#
#mv /lib/modules/2.4.29   <space in between>                 /tmp

check all the names please .....

we are trying to move off all ready created modules to /tmp directory .
Sorry,

Got it to compile with no errors.

I copied the bzImage to the boot folder and renamed it vmlinuz-2.4.29 as the other files are named.  Edited the grub.conf file to match the others with the 2.4.29 instead.  Will attempt to reboot and boot into kernel.

Ok well still get kernel panic and now cannot boot into 2.6 kernel.  Will have to re-ghost image and start again.

I really do appreciate all the help and I appologize for missing some of the spaces in the lines.

dont worry about it .Every body starts from scratch . Good that you have ghost image with you and loads of patience . THe methood we followed was correct .We need to try it precisely . I have did the same on my fedora core 3

surya.
Ok Surya,

Restored the image and started from scratch.

Downloaded the modutils (version 2.4.27) which is the latest.

Downloaded latest kernel (version 2.4.29)

Followed your proceedures:

untar it with
# tar -zxvf <filename>.tar.gz

# mkdir /usr/local/modutils
# cd modutils-xx.xx.xx  ( which you just now extracted )
# ./configure --prefix=/usr/local/modutils
# make all install

once this is done we have to prepare for kernel compilation

# PATH=/usr/local/modutils/sbin:$PATH
go to kernel directory .

I assume that the line above the go to kernel directory was to be typed in the kernel directory.  Just in case I typed it into both directories.

Then followed the following:

open the file called Makefile and find the line with /sbin/depmod and remove "/sbin" in the word as below
old
DEPMOD = /sbin/depmod
new
DEPMOD = depmod

after that kernel compilation

make mrproper

make menuconfig  --- put in the modules that are needed and removed some -- installed the ext3 support since the drives are formated this way, installed the SCSI support since this drive is a SCSI drive, removed sound since no sound card present, removed apgpart module since this seems to give me a problem every time I have tried including yesterday ( will touch on this later)

make dep

make clean

make bzImage

make modules

make modules_install

mkinitrd /boot/initrd-2.4.29.img 2.4.29

I then proceeded to copy my bzImage into the boot directory and edit my grub.conf file to match for boot.

The I am including the few lines before the error message that I get when I boot:

ds:  no socket drivers loaded!
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

So this is the error message that I get.  I will reboot the machine and paste in the grub.conf file so you can look at it and tell you what I have tried.

Once again thanks for all the help so far and for being very patient yourself.


the last step is make modules_install
Here is the complete grub.conf

# 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/sda2
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.4.29smp)
      root (hd0,0)
      kernel /vmlinuz-2.4.29 ro root=LABEL=/ rhgb
      initrd /initrd-2.4.29.img
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

I have tried changing the line at the end to root=/ and just obmit the LABEL part with no luck.  I have also tried changing it to root=/sda2 with no luck as well.

This is a SCSI drive that the machine is booting into.  The drive is partitioned with sda1 being the boot sda2 being the main drive and sda3 being swap.
>ds:  no socket drivers loaded!
>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

The above tells me that your all the above method is correct except for one thing .
How did you create the .config file for the kernel . ( the configuration file )
when you do a make menuconfig or xconfig make sure you select all the scsi modules .YOu might have missed them .
Hence it is panicing .

surya.

I guess I did not make a .config file.  I thought this was done when the make menuconfig file was saved.  I will try this again and work that in there.

I loaded up the SCSI driver that has been working on a redhat 9 and fC3 (2.6 kernel) which is the AIC 79xx driver.  This is the only one I loaded.  When the boot process is doing its thing it does find the drive just find as I see it up on the screen so this is why I am a bit confused.

Any other suggestions would be greatly appreciated.

Thanks
So tried switching to  /dev/sda2 and now I get the following error:

ds:  no socket drivers loaded!
kjournald starting.  Commit interval 5 seconds
EXT3-fs:  mounted filesystem with ordered data mode.
VFS:  Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory:  128k freed
Warning:  unable to open an initial console.

Not sure what is going on now with this but will still try and do the config thing first and try again,.

your .config is the problem . Ok do a make menuconfig agin and select all the relevant drivers and scsi . It takes some time to do it . But it is really worth doing it carefully . I doubt scsi drivers are not included so please check for those in the devices section . if in doubt select the option .

FYI ...  make menuconfig select the most generic options but how  does it know whether you have a scsi or something else .You have to do the selection for yourself .

just for more clarity on what hardware you have do an
#lspci
it will show you your hardware and taking that as a guideline build your kernel.

please update .

surya.
When I do the make menuconfig I do select the drivers that are needed.  For example I selected the ext3 support, the AIC79xx SCSI driver, removed the sound card all together, remove the apgpart which always gives an error when booting up.  So I do select the relevent files/drivers needed.

I will try the .config file and see what I can do.

do not remove which is already there - only add what you want - follow this as a thumb rule
you never know what you removed which will mess up again .
start from scratch please with make menuconfg.

surya.
will do and keep you posted.

well I recompiled with the default drivers loaded and with the ones I need in there to run.  I get the same error when booting into the one that says:

 kernel /vmlinuz-2.4.29 ro root=LABEL=/ rhgb

about not being able to mount the root blah blah blah

When I boot into the one that says

 kernel /vmlinuz-2.4.29 ro root=/dev/sda2

I get the other error about not being able to open an initial console.

I also get an apgpart error saying it cannot load it. This one is because I left it enabled in the kernel.

Not real sure which direction to go anymore.  Do you have any more ideas??????

Believe it is only the kernel compilation and picking right options makes the difference .
First time when I compiled kernel in my life it panicked for 15 days non stop. But every time It panicked I learned
something .

anyway why dont you try installing a precompiled rpm and see how it works
install this one and see....
http://download.fedora.redhat.com/pub/fedora/linux/core/1/i386/os/Fedora/RPMS/kernel-2.4.22-1.2115.nptl.i686.rpm

surya.
I will try that I just have a couple of question.  Forgive my ignorance on this.

Should I re-ghost the drive to start with a clean install or just go ahead and try this?  Second is what are the commands to do the installation from an RPM as I have done this once before but have not in a while?

Thanks
rpm -ivh filenam.rpm for rpm installation .

no need to re-ghost .

ok I downloaded the file and tried running the command and this is what I get:

[root@localhost ~]# rpm -ivh kernel-2.4.22-1.2115.nptl.i686.rpm
warning: kernel-2.4.22-1.2115.nptl.i686.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        kernel < 0:2.6 conflicts with udev-039-8.FC3.i386
[root@localhost ~]#
try forcing it lets see what happens ....

rpm -ivh <filename> --force --nodeps
Ok here is what I get:


[root@localhost ~]# rpm -ivh kernel-2.4.22-1.2115.nptl.i686.rpm --force --nodeps warning: kernel-2.4.22-1.2115.nptl.i686.rpm: V3 DSA signature: NOKEY, key ID 4f2 a6fd2
Preparing...                ########################################### [100%]
   1:kernel                 ########################################### [100%]
Version requires old depmod, but couldn't run depmod.old: No such file or direct ory
No dep file found for kernel 2.4.22-1.2115.nptl
mkinitrd failed
error: %post(kernel-2.4.22-1.2115.nptl.i686) scriptlet failed, exit status 1
[root@localhost ~]#
ok  do this and try again
# ln -s /usr/local/modutils/depmod /sbin/depmod.old

if it not happens then..
it is clear that  you have to get the kernel compiled or else I am not sure how is it possibel . One more thisg Fedora core 1 comes with 2.4 and you can also have 2.6 on that .
if you cant get  this kernel compiled you may have to try that .
Surya,

I really appreciate all the help you have provided on this.  You have shown a lot of patience and knowledge.  I tied to do the last thing that you have suggested but got a different error.  Anyhow I have been fighting this for a week now with very little results.  I would love to keep trying because I know there has be to a way to do it however due to project schedule I will have to continue on and bite the bullet and install Fedora Core 1 running the 2.4 kernel.  

I wish I could give you more points since you have tried real hard to help me out.  

Thanks for all the hard work and good luck.

Regards

Tony Mireles

Beleive me It is possible . Only patience is required . This is what I have learned with my experrience . If you have time raise a point here we will continue .

Good luck.