@item GRUB_DISABLE_NETBSD_RECOVERY
Disable the generation of recovery mode menu entries for NetBSD.
+@item GRUB_VIDEO_BACKEND
+If graphical video support is required, either because the @samp{gfxterm}
+graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set,
+then @command{grub-mkconfig} will normally load all available GRUB video
+drivers and use the one most appropriate for your hardware. If you need to
+override this for some reason, then you can set this option.
+
+After @command{grub-install} has been run, the available video drivers are
+listed in @file{/boot/grub/video.lst}.
+
@item GRUB_GFXMODE
Set the resolution used on the @samp{gfxterm} graphical terminal. Note that
you can only use modes which your graphics card supports via VESA BIOS
GRUB_TERMINAL_OUTPUT=
break;
fi
- # FIXME: this should do something smarter than just loading first
- # video backend.
- GRUB_VIDEO_BACKEND=$(head -n 1 ${GRUB_PREFIX}/video.lst || true)
- if [ -z "${GRUB_VIDEO_BACKEND}" ] ; then
+ if [ ! -s "${GRUB_PREFIX}/video.lst" ] ; then
if [ "x$termoutdefault" != "x1" ]; then
echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
fi
GRUB_FS \
GRUB_FONT_PATH \
GRUB_PRELOAD_MODULES \
- GRUB_VIDEO_BACKEND \
GRUB_PREFIX
# These are optional, user-defined variables.
GRUB_DISABLE_LINUX_UUID \
GRUB_DISABLE_LINUX_RECOVERY \
GRUB_DISABLE_NETBSD_RECOVERY \
+ GRUB_VIDEO_BACKEND \
GRUB_GFXMODE \
GRUB_BACKGROUND \
GRUB_THEME \
save_env saved_entry
fi
}
+
+function load_video {
+EOF
+if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
+ cat <<EOF
+ insmod ${GRUB_VIDEO_BACKEND}
+EOF
+else
+ # Insert all available backends; GRUB will use the most appropriate.
+ for backend in $(cat "${GRUB_PREFIX}/video.lst"); do
+ cat <<EOF
+ insmod ${backend}
+EOF
+ done
+fi
+cat <<EOF
+}
+
EOF
serial=0;
cat << EOF
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then
set gfxmode=${GRUB_GFXMODE}
+ load_video
insmod gfxterm
- insmod ${GRUB_VIDEO_BACKEND}
EOF
if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
&& is_path_readable_by_grub "$GRUB_THEME"; then
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
+ cat << EOF
+ load_video
+EOF
if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
&& grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
cat << EOF
EOF
fi
- # Load video drivers, which may be needed to allow the loader to program
- # modes for the kernel.
- # TODO: Other kernels may need the same mode programming, especially on
- # EFI. Should we move this somewhere more generic?
- for module in $(cat ${GRUB_PREFIX}/video.lst); do
- cat << EOF
- insmod $module
-EOF
- done
-
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
fi
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
- insmod ${GRUB_VIDEO_BACKEND}
+ load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then