PDA

View Full Version : [SOLVED] GRUB2 doesn't display custom entries.



hellmet
November 25th, 2009, 05:07 AM
UPDATE: Turns out there was a white space character in 40_custom. VIM couldn't delete it for some reason. I used gedit and that fixed it. Note: I still do not like GRUB2.

Aah.. GRUB2 is like a different bootloader altogether. Here's the issue.
I added a custom entry for FreeBSD in /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# 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.
menuentry "FreeBSD" {
set root=(hd0,1)
chainloader +1
}
I then did a
sudo update-grub2This is the resulting /boot/grub/grub.cfg: (See last few lines)


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,3)
search --no-floppy --fs-uuid --set 03f49ac6-ecd2-4223-bfd8-c53fab1f5de6
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,3)
search --no-floppy --fs-uuid --set 03f49ac6-ecd2-4223-bfd8-c53fab1f5de6
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=03f49ac6-ecd2-4223-bfd8-c53fab1f5de6 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,3)
search --no-floppy --fs-uuid --set 03f49ac6-ecd2-4223-bfd8-c53fab1f5de6
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=03f49ac6-ecd2-4223-bfd8-c53fab1f5de6 ro single
initrd /boot/initrd.img-2.6.31-15-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda2)" {
insmod ntfs
set root=(hd0,2)
search --no-floppy --fs-uuid --set 887898937898821c
chainloader +1
}
menuentry "openSUSE 11.1 (i586) (on /dev/sda7)" {
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 76af840a-cc08-4cd6-aa8c-86b2992a66fc
linux /boot/vmlinuz-2.6.27.7-9-default root=/dev/sda7
initrd /boot/initrd-2.6.27.7-9-default
}
menuentry "openSUSE 11.1 (i586) (on /dev/sda7)" {
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 76af840a-cc08-4cd6-aa8c-86b2992a66fc
linux /boot/vmlinux-2.6.27.7-9-default.gz root=/dev/sda7
}
### 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.
menuentry "FreeBSD" {
set root=(hd0,1)
chainloader +1
}

### END /etc/grub.d/40_custom ###
My custom FreeBSD menu entry is present in grub.cfg. However, when I reboot, I don't see the FreeBSD option. However, editing any entry and manually booting the FreeBSD partition, works! More info - doing a

sudo os-prober
/dev/sda2:Windows 7 (loader):Windows:chain
/dev/sda7:openSUSE 11.1 (i586):SuSE:linux
doesn't detect my FreeBSD install, while it had no issues with finding Windows and OpenSuse.

Any idea why grub.cfg would have something, yet not display it? I have run into a dead-end. There also seems to be little documentation (yet) on the web. Thanks!!