diff --git a/ChangeLog b/ChangeLog index dd519ce83..0220dd15a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-13 Felix Zielcke + + * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints + doestn't exist. Check also for /boot/kernel/kernel.gz. Print + `freebsd_loadenv' only when devices.hints exist. + 2009-04-13 Pavel Roskin * term/usb_keyboard.c (grub_usb_keyboard_getkey): Warning fixes. diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 61d5450b1..34f27d488 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -21,15 +21,16 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ . ${libdir}/grub/grub-mkconfig_lib -devices=/boot/devices.hints -if ! test -e ${devices} ; then - # not FreeBSD - exit 0 +if test -e /boot/devices.hints ; then + devices=/boot/devices.hints fi if test -e /boot/kernel/kernel ; then kfreebsd=/boot/kernel/kernel fi +if test -e /boot/kernel/kernel.gz ; then + kfreebsd=/boot/kernel/kernel.gz +fi if [ "x$kfreebsd" != "x" ] ; then echo "Found kernel of FreeBSD: $kfreebsd" >&2 @@ -38,9 +39,11 @@ if [ "x$kfreebsd" != "x" ] ; then kfreebsd_dirname=`dirname $kfreebsd` kfreebsd_rel_dirname=`make_system_path_relative_to_its_root $kfreebsd_dirname` - devices_basename=`basename $devices` - devices_dirname=`dirname $devices` - devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + if [ x"$devices" != "x" ] ; then + devices_basename=`basename $devices` + devices_dirname=`dirname $devices` + devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + fi root_device=`basename ${GRUB_DEVICE}` @@ -53,7 +56,13 @@ EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} +EOF + + if [ x"$devices" != "x" ] ; then + cat << EOF freebsd_loadenv ${devices_rel_dirname}/${devices_basename} +EOF + cat << EOF set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} } EOF