Click to See Complete Forum and Search --> : Problem compiling my first kernel


ddaas
02-17-2005, 06:14 AM
Hi,
I am new to kernel compilation. I have never compiled a kernel before.
Today I said I must learn how to compile my kernel (who knows when I need it )

1) I downloaded the kernel from kernel.org (2.4.29)
2) a) make menuconfig
b) make dep
c) make bzImage
d)make modules
e) make modules_install
3) cp the new compiled kernel vmlinuz-2.4.29 in /boot
4) configure the boot manager (grub) to user the new compiled kernel.


I am using RedHat 9.
The problem is that when I boot with my new kernel I get the following error:

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


Does anyone know what I did wrong?
For my old kernel I also use initrd /boot/initrd-2.4.20-8.img

How I get a good initrd image for my new kernel? Where can I get it from? Do I need it? Can anyone explain me what is this initrd*.img

thanks

retsaw
02-17-2005, 08:09 AM
You don't need an initrd if you compile what you need into the kernel, it is useful for situations where you need to load certain modules to be able to boot the system that you can't compile into the kernel or just don't know what you will need (which is the case for distros and livecds). If you want to create one there probably is a "mkinitrd" command that will do it for you.

As to the problem you are having, it is because you failed to compile in the option to read disklabels, I don't know which option that is as I don't use them myself but if you did a search for "Red Hat" and your error you might be able to find a correct solution. Alternatively, you can edit your /etc/fstab and change the "LABEL=<whatever>" part at the begining of each device entry to the actual device name.

quip
02-17-2005, 10:35 AM
Doesn't System.map need to be copied over, too? Try cp System.map /boot/System.map-2.4.29 You can label your System.maps with their version # so as to keep/not overwrite the old ones; the kernel will still use the correct one.

je_fro
03-12-2005, 06:57 PM
looks like you might have forgotten filesystem support for your / partition.

Satanic Atheist
03-16-2005, 11:21 AM
Also, before running <make menuconfig>, run <make clean> and <make mrproper> which both clean up the kernel source tree ready to compile.

Once you have a file storing your configuration (recommend you save it as something else in the "save configuration as" option rather than .config) then KEEP HOLD OF IT.

You can reuse the file whenever you upgrade the kernel and set new options and it makes life a lot easier. Note, keep it in /root or somewhere because the <make clean> and <make mrproper> can trash it.

Note, if you run X, you can run <make xconfig> instead of menuconfig to have it running nice and cushiony under X.

James