From: Colin Watson Date: Thu, 17 Jun 2010 15:01:17 +0000 (+0100) Subject: * util/grub-mkconfig.in: Stop setting GRUB_VIDEO_BACKEND. Make it X-Git-Tag: 1.99~804^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4311a9f0f0e59597f4afc68673db0f0f1968967;p=thirdparty%2Fgrub.git * util/grub-mkconfig.in: Stop setting GRUB_VIDEO_BACKEND. Make it available as a user override instead. Replace the gfxterm backend check with a check that ${GRUB_PREFIX}/video.lst is non-empty. * util/grub.d/00_header.in (load_video): New generated function. Call it before loading gfxterm rather than loading ${GRUB_VIDEO_BACKEND}. * util/grub.d/10_linux.in (linux_entry): Call load_video. * util/grub.d/30_os-prober.in (osx_entry): Likewise. * docs/grub.texi (Simple configuration): Document GRUB_VIDEO_BACKEND. --- diff --git a/docs/grub.texi b/docs/grub.texi index 9fe197da2..cea9f6a31 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -934,6 +934,16 @@ Disable the generation of recovery mode menu entries for Linux. @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 diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 836bd6318..6bdc166c9 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -181,10 +181,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do 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 @@ -242,7 +239,6 @@ export GRUB_DEVICE \ GRUB_FS \ GRUB_FONT_PATH \ GRUB_PRELOAD_MODULES \ - GRUB_VIDEO_BACKEND \ GRUB_PREFIX # These are optional, user-defined variables. @@ -265,6 +261,7 @@ export GRUB_DEFAULT \ GRUB_DISABLE_LINUX_UUID \ GRUB_DISABLE_LINUX_RECOVERY \ GRUB_DISABLE_NETBSD_RECOVERY \ + GRUB_VIDEO_BACKEND \ GRUB_GFXMODE \ GRUB_BACKGROUND \ GRUB_THEME \ diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 76e0bc32d..8040a7c9b 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -74,6 +74,24 @@ function savedefault { save_env saved_entry fi } + +function load_video { +EOF +if [ -n "${GRUB_VIDEO_BACKEND}" ]; then + cat < /dev/null \ && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then cat << EOF @@ -78,16 +81,6 @@ 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 diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index edef37e66..90e2e3d92 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -44,7 +44,7 @@ EOF 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