LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problems booting custom kernel (http://www.linuxquestions.org/questions/linux-general-1/problems-booting-custom-kernel-861614/)

smartacus 02-09-2011 09:55 AM

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.)

devUnix 02-09-2011 12:37 PM

Please, post your /etc/grub.conf file's contents here.

smartacus 02-10-2011 12:07 AM

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.


All times are GMT -5. The time now is 02:39 PM.