LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-06-2008, 01:50 AM   #1
mohit.saha
LQ Newbie
 
Registered: Feb 2008
Posts: 15

Rep: Reputation: 0
Unhappy Kernel Compilation: Solve The Error


I compiled my kernel... RHEL5 and kernel version 2.6.18-8.el5. I compiled the new kernel 2.6.24.3. The steps i followed are:
First i unpatched the kernel into a directory /home/src and it came in a folder linux-2.6.24.3. Then i cd'd into the folder

$cd /home/src/linux-2.6.24.3

After that i ran the following command:

$make mproper
$make xconfig (where i removed the ext3 file system, only change i made)
$make dep
$make clean
$make bzImage
$make modules
$make modules_install

Then i created initial ramdisk
$mkinitrd /boot/initrd-2.6.24.3.img 2.6.24.3

Then i copied the kenel and the system map
$cp arch/x86/boot/bzImage /boot/bzImage-2.6.24.3
$cp System.map /boot/System.map-2.6.24.3
$ln -s /boot/System.map-2.6.24.3 /boot/System.map

Then i changed the grub file in /etc/grub.conf and added the following lines:

title Test Kernel (2.6.24.3)
root(hd0,5) //this was given as in the earlier entry
kernel /bzImage-2.6.24.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.24.3.img

Then i rebooted the system... and from the grub menu chose the Test Kernel..
but it gives the error...

mount: error mounting /dev/root on /sysroot as ext3: No such device
setuproot: moving /dev failed: No such file or directory
setuproot: error mouting /proc: No such file or directory
setuproot: error mouting /sys: No such file or directory
swutchroot: mount failed: No such file or directory
kernel panic - not sysncing : attempted to kill init!

Could anyone please help me in removing this error and properly compile the kernel?
 
Old 03-06-2008, 07:52 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
You forgot somethings like creating a working kernel configuration before tweaking. You also did a few extra not needed steps and preformed some undesired/unnecessary work, the steps in order and the only steps one need to do are;

make mrproper
make oldconfig ;the step you missed
make menuconfig (or xconfig or gconfig here)
make
make modules_install
make install ;takes the place of the mkinitrd command, copying files and editing you did

The other junk you did is not required and it sounds like you using an old HOWTO as a reference, please get the updated reference for building a 2.6 kernel from here;

http://www.kernel.org/pub/linux/kern...le/gregkh/lkn/

You want(direct link): http://www.kernel.org/pub/linux/kern...kn_pdf.tar.bz2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 04:45 AM
Kernel compilation error windycity_linux Red Hat 1 12-17-2006 08:41 AM
kernel compilation error!! vishamr2000 Linux - General 2 05-12-2006 03:20 PM
kernel compilation error bond_7942 Linux - General 1 02-02-2005 05:35 AM
kernel compilation error bunty Linspire/Freespire 0 09-08-2004 10:22 AM


All times are GMT -5. The time now is 10:16 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration