LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in booting from compiled linux kernel in Fedora Core (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-booting-from-compiled-linux-kernel-in-fedora-core-622034/)

sagsriv 02-18-2008 12:09 PM

Problem in booting from compiled linux kernel in Fedora Core
 
I have Fedora Core installed in my machine. Recently I thought of compiling a new kernel source so I downloaded, compiled and installed the letest kernel source available. I followed the procedure

1.Downloaded sourcecode and unziped.

2.make mrproper

3.cp /boot/config-`uname -r` ./.config

4.make menuconfig
which brings up the kernel configuration menu. I Loaded an Alternate Configuration File and choose .config (which contains the configuration of my current working kernel) as the configuration file.

5.Then finished with Yes (Should I make some changes in .config?).

6.Then I used
make all
make modules_install
make install

Before that, my grub.conf looked like

# 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,6)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,6)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img

title Windows XP
rootnoverify (hd0,0)
chainloader +1

After that, I see following lines appended in my grub.conf
title Fedora Core (2.6.24.2 : Compiled version)
root (hd0,6)
kernel /vmlinuz-2.6.24.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.24.2.img

I have vmlinuz-2.6.24.2 and initrd-2.6.24.2.img file along with their previous(2.6.18-1.2798.fc6) versions in my /boot. But I have a symvers-2.6.18-1.2798.fc6.gz file whose 2.6.24.2 version is not available. Is that needed? If yes, how do I get that?

Now, the problem.

When I try to boot from my new kernel, after some normal outputs(ome messages and a few errors, which also come in my fc6 2.18 version booting) I get the following message:

RedHat nash version 5.1.19.03 starting
Reading all physical volumes. This may take long time.....
No volume groups found.
Volume group "VolGroup00" not found.
mount: could not find filesystem /dev/root
setuproot: mounting /dev failed : No such file or directory
setuproot: error mounting /proc No such file or directory
setuproot: error mounting /proc No such file or directory
setuproot: error mounting /sys No such file or directory
switchroot: mount failed No such file or directory
Kernel panic not syncing: Atempted to kill init!

After that the cursor goes blinking.But I can successfully boot from my fc6 2.18 version after restarting.

Can anyone help me?(I appologize if u feel I got too much expressive)

Lenard 02-18-2008 12:23 PM

Try again, this time;

make clean
make oldconfig
make menuconfig
make
make modules_install
make install

Far to many changes from the 2.6.18 kernel (as supplied by Fedora) to use the supplied kernel config file.

No, you do not need a symvers-<version-number>.gz file when you compile your own kernel.

b0uncer 02-18-2008 12:34 PM

Just make sure that when you compile the kernel you either compile the filesystem support you use in your disk into the kernel (not as a module), or use initrd file; otherwise there will be problems mounting the filesystem (because it's module can't be loaded before the filesystem is mounted, and it can't be mounted before the module is loaded). It depends, but it's not uncommon that ext3 is used as filesystem, and kernel has by default only ext2 support marked to be compiled in, and ext3 is marked to be compiled as a module (or even worse, not at all).

You don't need all the files possibly created by the make procedure, namely only the vmlinuz file is really needed (the kernel itself). The rest depend on your kernel configuration. It's a good idea to also copy the .config file to /boot/config-your-new-kernel-version to spare it, in case you compile a new kernel later and need the file (and you can use it <=> the new kernel version doesn't differ too much).

kilgoretrout 02-18-2008 12:39 PM

It obviously can't find your root filesystem and kernel panics as a result. That's usually because either the kernel does not have the necessary built in support to find and mount the root filesystem or the kernel has the necessary module support to do that but that initrd was not built with the necessary modules to find and mount your root filesystem. You have to go back and check your kernel configuration. I would suspect the module support is there but that initrd needs to be rebuilt. Exactly which modules you need to include in initrd is a function of your hardware and software environment.

Just a side note, I've tried using several distros .config files when compiling a new kernel to add some additional support and in every case but slackware, I've run into problems. Distro kernels are so heavily patched these days that it seems impossible to use this technique any more.


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