LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-09-2011, 08:55 AM   #1
smartacus
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Problems booting custom kernel


Hey everyone:

I am somewhat new to Linux, but very new to compiling a custom kernel, so please bear with me on this... I am attempting to compile kernel 2.6.23 after patching it with RTAI. I can compile and install the kernel just fine, but I cannot get the new kernel to boot.

When the kernel is booting, I get the error message:
Code:
ALERT! /dev/sda4 does not exist. Dropping to a shell!
I can boot into the generic kernel (Ubuntu 10.10) just fine by using an identical "root=" option, but for some reason this kernel will not recognize the partition. I checked the /dev directory and found no disk folder or anything related to my hard drive. When compiling the kernel, I copied the .config from the working kernel to use in this one, and modified it as little as possible, only unchecking an option or two as indicated in the RTAI Installation Guide. Is this a kernel issue or something that I've configured incorrectly for the boot command?

(I will follow up and post the grub.cfg file - I am currently not on the same machine.)
 
Old 02-09-2011, 11:37 AM   #2
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 550

Rep: Reputation: 46
Please, post your /etc/grub.conf file's contents here.
 
Old 02-09-2011, 11:07 PM   #3
smartacus
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
devUnix: The file /etc/grub.conf does not exist. (Or, when I use vi /etc/grub.conf I get a new file...)
---EDIT---: I just read up on Grub. Would it help to post the files in /etc/grub.d? I'm under the impression that you can see the contents of those from what I posted below, but let me know if it helps.

After much debate about deviating from the guide I posted a link to in the original post, I decided to recompile the kernel - this time using the exact kernel (2.6.19) and the same version of RTAI (3.5) in the guide. I followed the instructions step-by-step, I believe the patching was fine, and the configuration for the kernel is nearly identical to the config-2.6.35-22-generic file for the working kernel. The only difference from the guide is that I compiled under Ubuntu 10.10 and they used Xubuntu 7.04 (which has some driver incompatibilities with my system). I still get the same error about the hard drive (apparently) not being recognized and the /dev directory is nearly empty when I type ls /dev from the shell after the failed boot.

Here are the contents of /boot/grub/grub.cfg (note that the kernel in question is 2.6.19-rtai):
Code:
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro   quiet splash
        initrd  /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        echo    'Loading Linux 2.6.35-22-generic ...'
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro single
  echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.23.1-rtai' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        linux   /boot/vmlinuz-2.6.23.1-rtai root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro   quiet splash
        initrd  /boot/initrd.img-2.6.23.1-rtai
}
menuentry 'Ubuntu, with Linux 2.6.23.1-rtai (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
 echo    'Loading Linux 2.6.23.1-rtai ...'
        linux   /boot/vmlinuz-2.6.23.1-rtai root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro single
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.23.1-rtai
}
menuentry 'Ubuntu, with Linux 2.6.19-rtai' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        linux   /boot/vmlinuz-2.6.19-rtai root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro   quiet splash
        initrd  /boot/initrd.img-2.6.19-rtai
}
menuentry 'Ubuntu, with Linux 2.6.19-rtai (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
 set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        echo    'Loading Linux 2.6.19-rtai ...'
        linux   /boot/vmlinuz-2.6.19-rtai root=UUID=3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a ro single
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.19-rtai
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
        insmod part_msdos
insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos4)'
        search --no-floppy --fs-uuid --set 3a9ff353-1b7b-4a8d-96fc-5ec5cf3b2c8a
        linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda2)" {
        insmod part_msdos
        insmod ntfs
 set root='(hd0,msdos2)'
        search --no-floppy --fs-uuid --set 66d2e16dd2e141c3
        chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Thanks for your help.

Last edited by smartacus; 02-09-2011 at 11:24 PM.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom kernel not booting... marsques Linux - General 3 10-08-2010 02:47 PM
Is it possible to install a custom kernel without booting to the drive? Mark_667 Linux - Kernel 6 03-22-2009 10:08 AM
kernel panic while booting custom compiled 2.6.24 kernel on RHEL 4 AS samkraju Red Hat 4 02-10-2008 12:55 AM
Booting a 2.6.12 Custom Kernel in Debian pfizur Linux - Kernel 4 07-26-2006 07:39 PM
How do I make sure Im booting onto my custom kernel? Kramer Linux - General 10 10-21-2003 12:43 PM


All times are GMT -5. The time now is 03:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration