-   Linux - General (
-   -   Newbie Guide To Compiling A Kernel! (

DrOzz 09-01-2003 05:00 PM

ok sean, boot into your old kernel, and then when logged in, post your grub.conf file for we can see it...

andy18 09-07-2003 12:09 PM

Hi ,

I am trying to compile the kernel 2.4.22 on my local workstation for testing purposes before used it on production server.

I have tried go to /usr/src and there is no file at this directory.Usually I upgrade the kernel using rpm packages which I downloaded it from Redhat Network.

Can I straight away compile the kernel without going through the steps :

cd /usr/src
**"Change Directory To /usr/src"**

ls -alc
**"check for symlink (ex. /usr/src/linux->/usr/src/linux-2.4.18)"**

file linux
**"double check with this command (output ex.) linux: symbolic link to linux-2.4.18-14"**

rm linux
**"remove symlink"**

tar -zxvf linux-x.x.x.tar.gz
**"unpack the tarball (new kernel)"**

ln -s /usr/src/linux-x.x.x /usr/src/linux
**"make a new link to the new kernel"**

cd linux
**"type this to change to the directory"**


Thanks !

DrOzz 09-07-2003 12:28 PM

well your going to need the kernel source to recompile the kernel there is no question about if there is nothing in /usr/src then you will have to go get the source....if you wanted to just recompile the kernel you are currently using then you don't have to go to that site and do all that stuff, because you mentioned redhat and the kernel source is on the distros cd' can always type :: redhat-config-packages and install it that way, or manually find it on your cds ....
but if you want to put a newer kernel on your box, then yes you will have to go and do them steps...unless you get an rpm package somewheres with the kernel source, then you may be able to knock off a couple of steps, but again basically you are going to have to do that....

Electboy 09-07-2003 12:40 PM

Note : save a file ".config" in /usr/src/linux-x.xx if u want to keep old configuration. If u understand much your configuration u will be able to set up your own kernal configration

andy18 09-07-2003 04:36 PM


I have installed the kernel source and compiled the kernel 2.4.22 on my RH 8.0.

I have reach finished the process but when I reboot the box, I was not able to boot the box and getting the kernel panic error message :

VFS : Cannot open root device : LABEL=/dev/hdb6 or 00:00
Please append a correct "root" boot option
Kernel Panic : VFS : Unable to mount root fs on 00:00

My grub.conf file as follow :

# 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/hdb6
# initrd /initrd-version.img
title Red Hat Linux (2.4.22)
root (hd0,0)
kernel /vmlinuz-2.4.22 ro root=LABEL=/dev/hdb6
initrd /initrd-2.4.22.img
title Red Hat Linux (2.4.20-20.8)
root (hd0,0)
kernel /vmlinuz-2.4.20-20.8 ro root=LABEL=/
initrd /initrd-2.4.20-20.8.img
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img

I have tried changed the root boot option to root=/dev/hdb6 but the getting the same output.

Please advise.Thanks.

DrOzz 09-07-2003 05:36 PM

maybe its because you are using the label to point to the actual partition that root is located (i assume thats what /dev/hdb6 is) rather than just saying ::
or did you try that?

andy18 09-07-2003 07:00 PM


Problem fixed ! MY mistakes..the correct hdd should be hda6 and NOT hdb6...:D

Sorry guys...

I guess I will have to recompile my kernel again as the network port on the PC cannot be detected and iptables seems to be failed ....:mad:

What modules should I compile again in the Makefile so that I can set to compile my network?

andy18 09-07-2003 07:34 PM


After login to the root shell :

Perhaps iptables or your kernel need to be upgraded
iptables v1.2.8 : can't initialize iptables table 'filter' : iptables who?( do you need to insmod?)

Running ifconfig eth0 returns the below error message :

eth0:error fetching interface info : Device not found.

Thank you.

andy18 09-08-2003 04:42 PM


Ok solved it by recompiling the kernel with the on board Ethernet LAN enabled.

But I am getting the error message looping on my screen :

modprobe : modprobe : Cant locate module net-pf-1

Can I disable this "modprobe"?:confused:

DrOzz 09-08-2003 05:38 PM

just look in your /etc/modules.conf file and comment out the line thats trying to load comment out something you put a # in front of the for example something like ::
#alias whateverTHEmoduleIS

andy18 09-08-2003 06:27 PM


No luck :(

I have commented most of the entry in /etc/modules.conf.Below is my entry for the modules.conf file :

alias parport_lowlevel parport_pc
alias eth0 sis900
alias usb-controller usb-ohci
alias usb-controller ehci-hcd
alias sound_slot-0 i810-audio
post-install sound-slot-0 /bin/aumix-minimal -f /etc/aumixrc -L > /dev/null 2 > $ 11 2 > $1 ||;
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/aumixrc -S > /dev/null 2 > $ 2> &1 ||;

I have commented out all of the entry except alias eth0 sis900 and rebooted the PC but still the error message keep looping infinity on my screen.

Please help....Thanks

DrOzz 09-08-2003 09:32 PM

k i was just looking at the file :
and this comes from it::

Unix domain sockets
If you say Y here, you will include support for Unix domain sockets;
sockets are the standard Unix mechanism for establishing and
accessing network connections. Many commonly used programs such as
the X Window system and syslog use these sockets even if your
machine is not connected to any network. Unless you are working on
an embedded system or something similar, you therefore definitely
want to say Y here.

However, the socket support is also available as a module ( = code
which can be inserted in and removed from the running kernel
whenever you want). If you want to compile it as a module, say M
here and read <file:Documentation/modules.txt>. The module will be
called unix.o. If you try building this as a module and you have
said Y to "Kernel module loader support" above, be sure to add
'alias net-pf-1 unix' to your /etc/modules.conf file. Note that
several important services won't work correctly if you say M here
and then neglect to load the module.
so it looks like you selected that when you compiled your kernel, so in turn, the last thing i can think of without having to recompile again is to insert this into your /etc/modules.conf.
alias net-pf-1 off
best of luck! :D

Electboy 09-09-2003 11:07 PM

I had the same problem as yours. So i had to reinstall RH.
save a file ".config" in /usr/src/linux-x.x.x to other place
make mrproper
copy .config to /usr/src/linux-x.x.x (n your new kernel)
make menuconfig (if u want to change some thing in configuration, but note that u have to know much about kernel configuration)

Electboy 09-09-2003 11:19 PM

Note : do the steps that DrOzz said then make mrproper

DrOzz 09-10-2003 10:32 PM

is that the only way you could fix it electboy, or did you try what i said and it worked?

All times are GMT -5. The time now is 03:45 AM.