Source

vabs / var / vabs / grub2 / src / patches / grub2-VL.patch

Full commit
diff -Naur grub-1.99/util/grub.d/10_linux.in grub-1.99.patched//util/grub.d/10_linux.in
--- grub-1.99/util/grub.d/10_linux.in	2011-12-13 14:02:22.141285975 -0700
+++ grub-1.99.patched//util/grub.d/10_linux.in	2011-12-16 17:00:52.751609532 -0700
@@ -1,8 +1,7 @@
-#! /bin/sh
-set -e
+#! /bin/sh -e
 
 # grub-mkconfig helper script.
-# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+# Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,17 +21,12 @@
 bindir=@bindir@
 libdir=@libdir@
 . ${libdir}/grub/grub-mkconfig_lib
-
-export TEXTDOMAIN=@PACKAGE@
-export TEXTDOMAINDIR=@localedir@
-
-CLASS="--class gnu-linux --class gnu --class os"
+. /etc/default/grub
 
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
   OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
 fi
 
 # loop-AES arranges things so that /dev/loop/X can be our root device, but
@@ -44,85 +38,24 @@
 esac
 
 if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
-    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
-    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
 fi
 
-if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
-  rootsubvol="`make_system_path_relative_to_its_root /`"
-  rootsubvol="${rootsubvol#/}"
-  if [ "x${rootsubvol}" != x ]; then
-    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
-  fi
-fi
-
 linux_entry ()
 {
-  os="$1"
-  version="$2"
-  recovery="$3"
-  args="$4"
-  if ${recovery} ; then
-    title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
-  else
-    title="$(gettext_quoted "%s, with Linux %s")"
-  fi
-  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
-  if ! ${recovery} ; then
-      save_default_entry | sed -e "s/^/\t/"
-  fi
-
-  # 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" "${config}" 2> /dev/null \
-	  && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
-	  cat << EOF
-	set gfxpayload=keep
-EOF
-      fi
-  else
-      if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
-	  cat << EOF
-	load_video
-EOF
-      fi
-	  cat << EOF
-	set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
-EOF
-  fi
-
   cat << EOF
-	insmod gzio
+menuentry "$1" {
 EOF
-
-  if [ x$dirname = x/ ]; then
-    if [ -z "${prepare_root_cache}" ]; then
-      prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
-    fi
-    printf '%s\n' "${prepare_root_cache}"
-  else
-    if [ -z "${prepare_boot_cache}" ]; then
-      prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
-    fi
-    printf '%s\n' "${prepare_boot_cache}"
-  fi
-  message="$(gettext_printf "Loading Linux %s ..." ${version})"
+  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
   cat << EOF
-	echo	'$message'
-	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+	linux16	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro splash=silent vga=$VGA $2
 EOF
   if test -n "${initrd}" ; then
-    message="$(gettext_printf "Loading initial ramdisk ...")"
     cat << EOF
-	echo	'$message'
-	initrd	${rel_dirname}/${initrd}
+	initrd16 ${rel_dirname}/${initrd}
 EOF
   fi
   cat << EOF
@@ -130,19 +63,9 @@
 EOF
 }
 
-case x`uname -m` in
-    xi?86 | xx86_64)
-	list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
-                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
-              done` ;;
-    *) 
-	list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
-                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
-	     done` ;;
-esac
-
-prepare_boot_cache=
-prepare_root_cache=
+list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
+        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+      done`
 
 while [ "x$list" != "x" ] ; do
   linux=`version_find_latest $list`
@@ -156,43 +79,26 @@
 
   initrd=
   for i in "initrd.img-${version}" "initrd-${version}.img" \
-	   "initrd-${version}" "initramfs-${version}.img" \
-	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
-	   "initrd-${alt_version}" "initramfs-${alt_version}.img" \
-	   "initramfs-genkernel-${version}" \
-	   "initramfs-genkernel-${alt_version}"; do
+	   "initrd.img" "initrd-${version}" "initrd.img-${alt_version}" \
+	   "initrd-${alt_version}.img" "initrd-${alt_version}" \
+	   "initrd" "initrd.gz"; do
     if test -e "${dirname}/${i}" ; then
       initrd="$i"
       break
     fi
   done
-
-  config=
-  for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
-    if test -e "${i}" ; then
-      config="${i}"
-      break
-    fi
-  done
-
-  initramfs=
-  if test -n "${config}" ; then
-      initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
-  fi
-
   if test -n "${initrd}" ; then
     echo "Found initrd image: ${dirname}/${initrd}" >&2
-  elif test -z "${initramfs}" ; then
-    # "UUID=" magic is parsed by initrd or initramfs.  Since there's
-    # no initrd or builtin initramfs, it can't work here.
+  else
+    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
     linux_root_device_thisversion=${GRUB_DEVICE}
   fi
 
-  linux_entry "${OS}" "${version}" false \
+  linux_entry "${OS}, Linux ${version}" \
       "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
-  if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
-    linux_entry "${OS}" "${version}" true \
-	"single ${GRUB_CMDLINE_LINUX}"
+  if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
+    linux_entry "${OS}, Linux ${version} (TUI)" \
+	"2 ${GRUB_CMDLINE_LINUX}"
   fi
 
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
diff -Naur grub-1.99/util/grub.d/30_os-prober.in grub-1.99.patched//util/grub.d/30_os-prober.in
--- grub-1.99/util/grub.d/30_os-prober.in	2011-12-13 14:02:22.127285976 -0700
+++ grub-1.99.patched//util/grub.d/30_os-prober.in	2011-12-13 14:02:16.420286366 -0700
@@ -22,6 +22,7 @@
 libdir=@libdir@
 
 . ${libdir}/grub/grub-mkconfig_lib
+. /etc/default/grub
 
 if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
   exit 0
@@ -155,11 +156,11 @@
 	fi
 	printf '%s\n' "${prepare_boot_cache}"
 	cat <<  EOF
-	linux ${LKERNEL} ${LPARAMS}
+	linux16 ${LKERNEL} ${LPARAMS} splash=silent vga=$VGA
 EOF
         if [ -n "${LINITRD}" ] ; then
           cat << EOF
-	initrd ${LINITRD}
+	initrd16 ${LINITRD}
 EOF
         fi
         cat << EOF