[arch-commits] Commit in grub2/trunk (9 files)

Ronald van Haren ronald at archlinux.org
Wed Mar 17 12:50:25 CET 2010


    Date: Wednesday, March 17, 2010 @ 07:50:25
  Author: ronald
Revision: 72510

upgpkg: grub2 1.98-4
add some more grub-mkconfig script fixes thanks to mario @ FS#18715; keep install the old grub.cfg file so the user defined file does not get removed on upgrade

Added:
  grub2/trunk/20_memtest86+
  grub2/trunk/archlinux-script-fixes.patch
  grub2/trunk/background-image-in-mkconfig.patch
  grub2/trunk/gfxmenu-dependencies.patch
  grub2/trunk/grub.cfg
  grub2/trunk/grub.default
  grub2/trunk/hidden-timeout-fix.patch
  grub2/trunk/menucolors-in-mkconfig.patch
Modified:
  grub2/trunk/PKGBUILD

------------------------------------+
 20_memtest86+                      |   27 ++++++++++++++++
 PKGBUILD                           |   37 ++++++++++++++-------
 archlinux-script-fixes.patch       |   59 +++++++++++++++++++++++++++++++++++
 background-image-in-mkconfig.patch |   35 ++++++++++++++++++++
 gfxmenu-dependencies.patch         |   32 ++++++++++++++++++
 grub.cfg                           |   32 ++++++++++++++++++
 grub.default                       |   42 ++++++++++++++++++++++++
 hidden-timeout-fix.patch           |   12 +++++++
 menucolors-in-mkconfig.patch       |   29 +++++++++++++++++
 9 files changed, 292 insertions(+), 13 deletions(-)

Added: 20_memtest86+
===================================================================
--- 20_memtest86+	                        (rev 0)
+++ 20_memtest86+	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,27 @@
+#! /bin/sh -e
+########################################################
+# This script generates a memtest86+ entry on grub.cfg #
+# if memtest is installed on the system.               #
+########################################################
+
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+
+. ${libdir}/grub/grub-mkconfig_lib
+
+MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
+CLASS="--class memtest86 --class gnu --class tool"
+
+if [ -e $MEMTEST86_IMAGE ] && is_path_readable_by_grub $MEMTEST86_IMAGE; then
+  # image exists, create menu entry
+  echo "Found memtest86+ image: $MEMTEST86_IMAGE" >&2
+  cat << EOF
+menuentry "Memory test (memtest86+)" $CLASS {
+EOF
+  prepare_grub_to_access_device `${grub_probe} --target=device $MEMTEST86_IMAGE` | sed -e "s/^/  /"
+  cat << EOF
+  linux16 (\$root)`make_system_path_relative_to_its_root $MEMTEST86_IMAGE`
+}
+EOF
+fi

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-17 11:11:36 UTC (rev 72509)
+++ PKGBUILD	2010-03-17 11:50:25 UTC (rev 72510)
@@ -4,7 +4,7 @@
 
 pkgname=grub2
 pkgver=1.98
-pkgrel=3
+pkgrel=4
 pkgdesc="The GNU GRand Unified Bootloader"
 url="http://www.gnu.org/software/grub/"
 arch=('i686' 'x86_64')
@@ -12,24 +12,30 @@
 depends=('sh' 'lzo2' 'freetype2')
 optdepends=('ruby:usr/share/grub/genmk.rb script' 'libusb: /sbin/grub-emu')
 makedepends=('bdf-unifont' 'ruby')
-backup=('boot/grub/grub.cfg')
+backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
 conflicts=('grub')
 provides=('grub')
-install=${pkgname}.install
 source=(ftp://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.gz  
-	'grubconfig.archlinux.patch' '05_archtheme')
-md5sums=('c0bcf60e524739bb64e3a2d4e3732a59'
-         'c71f5b20b35f3e1da5e9e3577e486af3'
-         'e143ae2e453b7c3ced309667df30da55')
+	'archlinux-script-fixes.patch' 'gfxmenu-dependencies.patch'
+   	'menucolors-in-mkconfig.patch' 'background-image-in-mkconfig.patch'
+	'hidden-timeout-fix.patch' 'grub.default' 'grub.cfg' '20_memtest86+')
+md5sums=('c0bcf60e524739bb64e3a2d4e3732a59'         '0910da120700a6928cd0290211acc79f'
+         '897f8af2fc83fcdaf7329da39f06d3dc'         '00ae9ff8991b8f00ab90739859af2921'
+         'fa14d3feabe17ac11dd3163501a66155'         '81bcdf26aa01b08b9925d72cbc4c3dab'
+         'ff99d316b0c59e514e5bb641a392d330'         '743215998a581a54ac77630f0db222ce'
+         '5a07e04c4ecb8ed145d54fec3043e0d5')
 
 build() {
-  cd $srcdir/grub-${pkgver}/util/grub.d
+  cd $srcdir/grub-${pkgver}
 
-  # modify scripts to detect Arch Linux kernels
-  patch -Np3 -i ${srcdir}/grubconfig.archlinux.patch || return 1
+  # some random patches to facilitate automatic creation of grub.cfg
+  patch -Np1 -i ${srcdir}/archlinux-script-fixes.patch || return 1
+  patch -Np1 -i ${srcdir}/gfxmenu-dependencies.patch || return 1
+  patch -Np1 -i ${srcdir}/menucolors-in-mkconfig.patch || return 1
+  patch -Np1 -i ${srcdir}/background-image-in-mkconfig.patch || return 1
+  patch -Np1 -i ${srcdir}/hidden-timeout-fix.patch || return 1
 
   # run autogen.sh to create configure files
-  cd ../..
   ./autogen.sh
 
   # fix unifont.bdf location
@@ -46,7 +52,12 @@
   cd $srcdir/grub-${pkgver}
   make DESTDIR=${pkgdir} install || return 1
 
-  # install script to set default colors
-  install -Dm755 ${srcdir}/05_archtheme ${pkgdir}/etc/grub.d/05_archtheme
+  # install /etc/default/grub
+  install -Dm644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub
 
+  # install grub.cfg (needed so it doesn't get removed on upgrading because it was previously here)
+  install -Dm644 ${srcdir}/grub.cfg ${pkgdir}/boot/grub/grub.cfg
+
+  # install memtest config detection
+  install -Dm755 ${srcdir}/20_memtest86+ ${pkgdir}/etc/grub.d/20_memtest86+
 }

Added: archlinux-script-fixes.patch
===================================================================
--- archlinux-script-fixes.patch	                        (rev 0)
+++ archlinux-script-fixes.patch	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,59 @@
+diff -ur grub-1.98.orig/util/grub.d/10_linux.in grub-1.98/util/grub.d/10_linux.in
+--- grub-1.98.orig/util/grub.d/10_linux.in	2010-03-13 22:10:15.953099258 -0400
++++ grub-1.98/util/grub.d/10_linux.in	2010-03-13 22:10:44.217896122 -0400
+@@ -30,8 +30,8 @@
+ 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]') ${CLASS}"
++  OS="${GRUB_DISTRIBUTOR}"
++  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | tr -d ' ') ${CLASS}"
+ fi
+ 
+ # loop-AES arranges things so that /dev/loop/X can be our root device, but
+@@ -46,7 +46,7 @@
+     || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
+   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ else
+-  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
++  LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
+ fi
+ 
+ linux_entry ()
+@@ -97,7 +97,7 @@
+ EOF
+ }
+ 
+-list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
++list=`for i in /boot/vmlinu[xz]* /vmlinu[xz]* ; do
+         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+       done`
+ prepare_boot_cache=
+@@ -109,13 +109,12 @@
+   dirname=`dirname $linux`
+   rel_dirname=`make_system_path_relative_to_its_root $dirname`
+   version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+-  alt_version=`echo $version | sed -e "s,\.old$,,g"`
++  base_init=`echo $basename | sed -e "s,vmlinuz,kernel,g"`
++  alt_version="${base_init}-fallback"
+   linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ 
+   initrd=
+-  for i in "initrd.img-${version}" "initrd-${version}.img" \
+-	   "initrd-${version}" "initrd.img-${alt_version}" \
+-	   "initrd-${alt_version}.img" "initrd-${alt_version}"; do
++  for i in "${base_init}.img"; do
+     if test -e "${dirname}/${i}" ; then
+       initrd="$i"
+       break
+@@ -130,6 +129,9 @@
+ 
+   linux_entry "${OS}" "${version}" false \
+       "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++  initrd="${alt_version}.img"
++  linux_entry "${OS}" "${version} Fallback" false \
++      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+   if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
+     linux_entry "${OS}" "${version}" true \
+ 	"single ${GRUB_CMDLINE_LINUX}"

Added: background-image-in-mkconfig.patch
===================================================================
--- background-image-in-mkconfig.patch	                        (rev 0)
+++ background-image-in-mkconfig.patch	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,35 @@
+diff -urN grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
+--- grub-1.98.orig/util/grub.d/00_header.in	2010-03-10 20:30:56.319608325 -0400
++++ grub-1.98/util/grub.d/00_header.in	2010-03-10 23:01:20.856612701 -0400
+@@ -104,6 +104,20 @@
+     terminal gfxterm
+   fi
+ EOF
++if [ x$GRUB_BACKGROUND != x ] && [ -f $GRUB_BACKGROUND ] \
++	&& is_path_readable_by_grub $GRUB_BACKGROUND; then
++    echo "Found background: $GRUB_BACKGROUND" >&2
++    case $GRUB_BACKGROUND in 
++        *.png)         reader=png ;;
++        *.tga)         reader=tga ;;
++        *.jpg|*.jpeg)  reader=jpeg ;;
++    esac
++    prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_BACKGROUND` | sed -e "s/^/  /"
++    cat << EOF
++  insmod $reader
++  background_image (\$root)`make_system_path_relative_to_its_root $GRUB_BACKGROUND`
++EOF
++fi
+ if [ x$GRUB_THEME != x ] && [ -f $GRUB_THEME ] \
+ 	&& is_path_readable_by_grub $GRUB_THEME; then
+     echo "Found theme: $GRUB_THEME" >&2
+diff -urN grub-1.98.orig/util/grub-mkconfig.in grub-1.98/util/grub-mkconfig.in
+--- grub-1.98.orig/util/grub-mkconfig.in	2010-03-10 20:30:56.319608325 -0400
++++ grub-1.98/util/grub-mkconfig.in	2010-03-10 20:34:00.689582261 -0400
+@@ -220,6 +220,7 @@
+   GRUB_DISABLE_LINUX_UUID \
+   GRUB_DISABLE_LINUX_RECOVERY \
+   GRUB_GFXMODE \
++  GRUB_BACKGROUND \
+   GRUB_THEME \
+   GRUB_GFXPAYLOAD_LINUX \
+   GRUB_DISABLE_OS_PROBER \

Added: gfxmenu-dependencies.patch
===================================================================
--- gfxmenu-dependencies.patch	                        (rev 0)
+++ gfxmenu-dependencies.patch	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,32 @@
+diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
+--- grub-1.98.orig/util/grub.d/00_header.in	2010-03-12 12:54:12.686589681 -0400
++++ grub-1.98/util/grub.d/00_header.in	2010-03-13 01:55:04.425437673 -0400
+@@ -108,6 +108,28 @@
+ 	&& is_path_readable_by_grub $GRUB_THEME; then
+     echo "Found theme: $GRUB_THEME" >&2
+     prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_THEME` | sed -e "s/^/  /"
++    theme_dir=`dirname $GRUB_THEME`
++    old_reader="null"
++    # add any font dependency
++    for f in ${theme_dir}/*.pf2 ; do
++        if [ -e $f ] ; then
++            echo "  loadfont (\$root)`make_system_path_relative_to_its_root $f`"
++        fi
++    done 
++    # adding insmod dependencies for images
++    for f in ${theme_dir}/*.{jpg,jpeg,png,tga} ; do
++        if [ -e $f ] ; then
++            case $f in
++                *.png)         reader=png ;;
++                *.tga)         reader=tga ;;
++                *.jpg|*.jpeg)  reader=jpeg ;;
++            esac
++            if [ $old_reader != $reader ] ; then
++               echo "  insmod ${reader}"
++                old_reader=$reader
++            fi
++         fi
++    done 
+     cat << EOF
+   insmod gfxmenu
+   set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`

Added: grub.cfg
===================================================================
--- grub.cfg	                        (rev 0)
+++ grub.cfg	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,32 @@
+# Config file for GRUB2 - The GNU GRand Unified Bootloader
+# /boot/grub/grub.cfg
+
+# DEVICE NAME CONVERSIONS
+#
+#  Linux           Grub
+# -------------------------
+#  /dev/fd0        (fd0)
+#  /dev/sda        (hd0)
+#  /dev/sdb2       (hd1,2)
+#  /dev/sda3       (hd0,3)
+#
+
+# Timeout for menu
+set timeout=5
+
+# Set default boot entry as Entry 0
+set default=0
+
+# (0) Arch Linux
+menuentry "Arch Linux" {
+set root=(hd0,1)
+linux /vmlinuz26 root=/dev/sda1 ro
+initrd /kernel26.img
+}
+
+## (1) Windows
+#menuentry "Windows" {
+#set root=(hd0,3)
+#chainloader +1
+#}
+

Added: grub.default
===================================================================
--- grub.default	                        (rev 0)
+++ grub.default	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,42 @@
+# If you change this file, run 'update-grub' afterwards to update
+# /boot/grub/grub.cfg.
+
+GRUB_DEFAULT=0
+GRUB_TIMEOUT=5
+GRUB_DISTRIBUTOR="Arch Linux"
+GRUB_CMDLINE_LINUX_DEFAULT="quiet"
+GRUB_CMDLINE_LINUX=""
+
+# Uncomment to enable Hidden Menu, and optionally hide the timeout count
+#GRUB_HIDDEN_TIMEOUT=5
+#GRUB_HIDDEN_TIMEOUT_QUIET=true
+
+# Uncomment to disable graphical terminal
+#GRUB_TERMINAL=console
+
+# The resolution used on graphical terminal
+# note that you can use only modes which your graphic card supports via VBE
+# you can see them in real GRUB with the command `vbeinfo'
+#GRUB_GFXMODE=1024x768x24
+
+# Uncomment to allow the kernel use the same resolution used by grub
+#GRUB_GFXPAYLOAD_LINUX=keep
+
+# Uncomment if you want GRUB to pass to the Linux kernel the old parameter 
+# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" 
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+#GRUB_DISABLE_LINUX_RECOVERY="true"
+
+# Uncomment and set to the desired menu colors.  Used by normal and wallpaper 
+# modes only.  Entries specified as foreground/background.
+GRUB_COLOR_NORMAL="light-blue/black"
+GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
+
+# Uncomment one of them for the gfx desired, a image background or a gfxtheme
+#GRUB_BACKGROUND="/path/to/wallpaper"
+#GRUB_THEME="/path/to/gfxtheme"
+
+# Uncomment to get a beep at GRUB start
+#GRUB_INIT_TUNE="480 440 1"

Added: hidden-timeout-fix.patch
===================================================================
--- hidden-timeout-fix.patch	                        (rev 0)
+++ hidden-timeout-fix.patch	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,12 @@
+diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
+--- grub-1.98.orig/util/grub.d/00_header.in	2010-03-11 00:36:05.766730374 -0400
++++ grub-1.98/util/grub.d/00_header.in	2010-03-11 00:40:49.046203888 -0400
+@@ -150,7 +150,7 @@
+   fi
+   cat << EOF
+ if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
+-  set timeout=${GRUB_TIMEOUT}
++  set timeout=0
+ fi
+ EOF
+ else

Added: menucolors-in-mkconfig.patch
===================================================================
--- menucolors-in-mkconfig.patch	                        (rev 0)
+++ menucolors-in-mkconfig.patch	2010-03-17 11:50:25 UTC (rev 72510)
@@ -0,0 +1,29 @@
+diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
+--- grub-1.98.orig/util/grub.d/00_header.in	2010-03-11 00:36:05.766730374 -0400
++++ grub-1.98/util/grub.d/00_header.in	2010-03-11 00:36:27.252903963 -0400
+@@ -59,6 +59,13 @@
+ }
+ EOF
+ 
++if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
++    cat << EOF
++set menu_color_normal=$GRUB_COLOR_NORMAL
++set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
++
++EOF
++fi
+ case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
+   serial:* | *:serial)
+     if ! test -e ${grub_prefix}/serial.mod ; then
+diff -ur grub-1.98.orig/util/grub-mkconfig.in grub-1.98/util/grub-mkconfig.in
+--- grub-1.98.orig/util/grub-mkconfig.in	2010-03-11 00:36:05.781282507 -0400
++++ grub-1.98/util/grub-mkconfig.in	2010-03-11 00:36:21.511483268 -0400
+@@ -223,6 +223,8 @@
+   GRUB_THEME \
+   GRUB_GFXPAYLOAD_LINUX \
+   GRUB_DISABLE_OS_PROBER \
++  GRUB_COLOR_NORMAL \
++  GRUB_COLOR_HIGHLIGHT \
+   GRUB_INIT_TUNE \
+   GRUB_SAVEDEFAULT
+ 



More information about the arch-commits mailing list