]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkconfig.in: Capitalise and export GRUB_PREFIX.
authorColin Watson <cjwatson@ubuntu.com>
Sat, 12 Jun 2010 14:06:53 +0000 (15:06 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Sat, 12 Jun 2010 14:06:53 +0000 (15:06 +0100)
* util/grub.d/00_header.in: Use GRUB_PREFIX rather than computing it
again.
* util/grub.d/10_linux.in (linux_entry): Load all video drivers,
which may be needed to allow the loader to program modes for the
kernel.

util/grub-mkconfig.in
util/grub.d/00_header.in
util/grub.d/10_linux.in

index d916459d6a511afa2b64efd8e7985a5be8aa6e33..836bd631808cfbbcdc2e93c0a68563b78780ab47 100644 (file)
@@ -92,11 +92,11 @@ case "$host_os" in
 netbsd* | openbsd*)
     # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
     # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
+    GRUB_PREFIX=`echo /grub | sed ${transform}`
     ;;
 *)
     # Use /boot/grub by default.
-    grub_prefix=`echo /boot/grub | sed ${transform}`
+    GRUB_PREFIX=`echo /boot/grub | sed ${transform}`
     ;;
 esac
 
@@ -137,9 +137,9 @@ else
     exit 1
 fi
 
-mkdir -p ${grub_prefix}
+mkdir -p ${GRUB_PREFIX}
 
-if test -e ${grub_prefix}/device.map ; then : ; else
+if test -e ${GRUB_PREFIX}/device.map ; then : ; else
   ${grub_mkdevicemap}
 fi
 
@@ -174,7 +174,7 @@ fi
 for x in ${GRUB_TERMINAL_OUTPUT}; do
     if [ "x${x}" = "xgfxterm" ]; then
         # If this platform supports gfxterm, try to use it.
-       if ! test -e ${grub_prefix}/gfxterm.mod ; then
+       if ! test -e ${GRUB_PREFIX}/gfxterm.mod ; then
            if [ "x$termoutdefault" != "x1" ]; then
                echo "gfxterm isn't available on your platform" >&2 ; exit 1
            fi
@@ -183,7 +183,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do
        fi
         # FIXME: this should do something smarter than just loading first
         # video backend.
-       GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true)
+       GRUB_VIDEO_BACKEND=$(head -n 1 ${GRUB_PREFIX}/video.lst || true)
        if [ -z "${GRUB_VIDEO_BACKEND}" ] ; then
            if [ "x$termoutdefault" != "x1" ]; then
                echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
@@ -242,7 +242,8 @@ export GRUB_DEVICE \
   GRUB_FS \
   GRUB_FONT_PATH \
   GRUB_PRELOAD_MODULES \
-  GRUB_VIDEO_BACKEND
+  GRUB_VIDEO_BACKEND \
+  GRUB_PREFIX
 
 # These are optional, user-defined variables.
 export GRUB_DEFAULT \
index 791840a604c3ebefe257220dcc540369df62b77e..76e0bc32dbcf954dfe4c46164a2025f4f0a72eec 100644 (file)
@@ -21,8 +21,7 @@ transform="@program_transform_name@"
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
-grub_prefix=`echo /boot/grub | sed ${transform}`
-locale_dir=`echo /boot/grub/locale | sed ${transform}`
+locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
 grub_lang=`echo $LANG | cut -d _ -f 1`
 
 . ${libdir}/grub/grub-mkconfig_lib
@@ -89,7 +88,7 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
 done
 
 if [ "x$serial" = x1 ]; then
-    if ! test -e ${grub_prefix}/serial.mod ; then
+    if ! test -e ${GRUB_PREFIX}/serial.mod ; then
        echo "Serial terminal not available on this platform." >&2 ; exit 1
     fi
 
index 416ab6ed6e79d5418f7fc22033e9ee4b097c89b0..b2cff628d3b5e5c21e5ba64b0e1d755a44489b7a 100644 (file)
@@ -78,6 +78,16 @@ 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