Package: grub-pc
Version: 1.96+20080724-8
Severity: wishlist
Tags: patch

On some computers the screen display is not scaled if operated on a low
resolution. Instead, the image is simply displayed smaller. It should be
made easy to change the resolution that grub expects (defaults to 640x480).

The resolution could be encoded in a variable in /etc/default/grub, e.g.
GRUB_GEOMETRY. If the value of this is changed, the background picture
might become unusable. Therefore it is necessary to create one if the
picture in this resolution was not present before. Took the command
(rsvg) for that from bug #465087.

Missing in patch:
* Clean up unneeded automatically created pictures in 05_debian_theme.
* Automatically detect the correct panel resolution in update-grub.

-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/mapper/gucky-root / ext3 rw,errors=remount-ro,data=ordered 0 0
/dev/mapper/gucky-root /dev/.static/dev ext3
rw,errors=remount-ro,data=ordered 0 0
/dev/hda1 /boot ext3 rw,errors=continue,data=ordered 0 0
/dev/mapper/gucky-home /home ext3 rw,errors=continue,data=ordered 0 0
/dev/mapper/gucky-tmp /tmp ext3 rw,errors=continue,data=ordered 0 0
/dev/mapper/gucky-usr /usr ext3 rw,errors=continue,data=ordered 0 0
/dev/mapper/gucky-var /var ext3 rw,errors=continue,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)   /dev/hda
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/update-grub using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
set timeout=5
set root=(hd0,1)
search --fs-uuid --set 6e31361b-1310-4f39-b039-47fa5c0aefc8
if font /grub/ascii.pff ; then
  set gfxmode=1024x768
  insmod gfxterm
  insmod vbe
  terminal gfxterm
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set root=(hd0,1)
search --fs-uuid --set 6e31361b-1310-4f39-b039-47fa5c0aefc8
insmod png
if background_image /grub/debian-blueish-wallpaper-1024x768.png ; then
  set color_normal=black/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_hurd ###
### END /etc/grub.d/10_hurd ###

### BEGIN /etc/grub.d/10_linux ###
set root=(hd0,1)
search --fs-uuid --set 6e31361b-1310-4f39-b039-47fa5c0aefc8
menuentry "Debian GNU/Linux, linux 2.6.25-2-686" {
        linux   /vmlinuz-2.6.25-2-686 root=/dev/mapper/gucky-root ro  vga=792 
splash
        initrd  /initrd.img-2.6.25-2-686
}
menuentry "Debian GNU/Linux, linux 2.6.25-2-686 (single-user mode)" {
        linux   /vmlinuz-2.6.25-2-686 root=/dev/mapper/gucky-root ro single
        initrd  /initrd.img-2.6.25-2-686
}
menuentry "Debian GNU/Linux, linux 2.6.18-6-686" {
        linux   /vmlinuz-2.6.18-6-686 root=/dev/mapper/gucky-root ro  vga=792 
splash
        initrd  /initrd.img-2.6.18-6-686
}
menuentry "Debian GNU/Linux, linux 2.6.18-6-686 (single-user mode)" {
        linux   /vmlinuz-2.6.18-6-686 root=/dev/mapper/gucky-root ro single
        initrd  /initrd.img-2.6.18-6-686
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file is an example on how to add custom entries
### END /etc/grub.d/40_custom ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: lenny/sid
  APT prefers stable
  APT policy: (990, 'stable'), (400, 'testing'), (90, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.25-2-686
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]    1.5.11etch2     Debian configuration
management sy
ii  grub-common              1.96+20080724-8 GRand Unified Bootloader,
version
ii  libc6                    2.7-13          GNU C Library: Shared libraries
ii  liblzo2-2                2.03-1          data compression library
ii  libncurses5              5.6+20080713-1  shared libraries for
terminal hand

grub-pc recommends no packages.

-- debconf information:
* grub-pc/linux_cmdline:
* grub-pc/chainload_from_menu.lst: true


-- 
Olaf Mandel   <[EMAIL PROTECTED]>   <http://www.olaf.mandel.name/>
PGP key:      1024D/33398848 2002-09-19
Fingerprint:  0E33 BEA6 1A71 9C5E 62BD  FC0E 99A7 D2C6 3339 8848
diff -urN grub2-1.96+20080724/debian/default/grub grub2-1.96+20080724_new/debian/default/grub
--- grub2-1.96+20080724/debian/default/grub	2008-08-19 23:33:17.000000000 -0700
+++ grub2-1.96+20080724_new/debian/default/grub	2008-08-19 23:42:38.000000000 -0700
@@ -5,8 +5,19 @@
 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
 GRUB_CMDLINE_LINUX=
 
+# Uncomment to add parameters to the "normal" kernel lines, but not to the
+# "(single user)" ones
+#GRUB_CMDLINE_LINUX_DEFAULT="vga=791 splash"
+
+# Uncomment to overwrite the default resolution
+#GRUB_GEOMETRY=1024x768
+
 # Uncomment to disable graphical terminal (grub-pc only)
 #GRUB_TERMINAL=console
 
 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
 #GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to automatically generate missing background images in this
+# directory
+#GRUB_AUTOGEN_IMAGE_DIR=/boot/grub
diff -urN grub2-1.96+20080724/debian/grub.d/05_debian_theme grub2-1.96+20080724_new/debian/grub.d/05_debian_theme
--- grub2-1.96+20080724/debian/grub.d/05_debian_theme	2008-08-19 23:33:17.000000000 -0700
+++ grub2-1.96+20080724_new/debian/grub.d/05_debian_theme	2008-08-20 00:06:16.000000000 -0700
@@ -13,21 +13,36 @@
 # check for usable backgrounds
 use_bg=false
 if [ "$GRUB_TERMINAL" = "gfxterm" ] ; then
-  for i in {/boot/grub,/usr/share/images/desktop-base}/debian-blueish-wallpaper-640x480.{png,tga} ; do
-    if is_path_readable_by_grub $i ; then 
-      bg=$i
-      case ${bg} in
-        *.png)		reader=png ;;
-        *.tga)		reader=tga ;;
-        *.jpg|*.jpeg)	reader=jpeg ;;
-      esac
-      if test -e /boot/grub/${reader}.mod ; then
-        echo "Found Debian background: `basename ${bg}`" >&2
-        use_bg=true
-        break
+  if [ "x$GRUB_AUTOGEN_IMAGE_DIR" = "x" -o "x`which rsvg`" = "x" -o \! -e /boot/grub/png.mod ]; then
+    for i in {/boot/grub,/usr/share/images/desktop-base}/debian-blueish-wallpaper-${GRUB_GEOMETRY}.{png,tga,jpg,jpeg} ; do
+      if is_path_readable_by_grub $i ; then 
+        bg=$i
+        case ${bg} in
+          *.png)		reader=png ;;
+          *.tga)		reader=tga ;;
+          *.jpg|*.jpeg)	reader=jpeg ;;
+        esac
+        if test -e /boot/grub/${reader}.mod ; then
+          echo "Found Debian background: `basename ${bg}`" >&2
+          use_bg=true
+          break
+        fi
       fi
+    done
+  else
+    bg=${GRUB_AUTOGEN_IMAGE_DIR}/debian-blueish-wallpaper-${GRUB_GEOMETRY}.png
+    reader=png
+    if [ -f "$bg" ] && is_path_readable_by_grub "$bg"; then
+      echo "Found Debian background: `basename ${bg}`" >&2
+      use_bg=true
+    elif [ -f /usr/share/images/desktop-base/debian-blueish-wallpaper.svg -a -d "${GRUB_AUTOGEN_IMAGE_DIR}" ]; then
+      echo "Generating Debian background: `basename ${bg}`" >&2
+      w=`echo ${GRUB_GEOMETRY}|sed 's/x.*//'`
+      h=`echo ${GRUB_GEOMETRY}|sed 's/.*x//'`
+      rsvg -w $w -h $h /usr/share/images/desktop-base/debian-blueish-wallpaper.svg "$bg"
+      use_bg=true
     fi
-  done
+  fi
 fi
 
 # set the background if possible
diff -urN grub2-1.96+20080724/util/grub.d/00_header.in grub2-1.96+20080724_new/util/grub.d/00_header.in
--- grub2-1.96+20080724/util/grub.d/00_header.in	2008-06-21 06:51:19.000000000 -0700
+++ grub2-1.96+20080724_new/util/grub.d/00_header.in	2008-08-19 23:04:58.000000000 -0700
@@ -43,7 +43,7 @@
     prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
     cat << EOF
 if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
-  set gfxmode=640x480
+  set gfxmode=${GRUB_GEOMETRY}
   insmod gfxterm
   insmod vbe
   terminal gfxterm
diff -urN grub2-1.96+20080724/util/update-grub.in grub2-1.96+20080724_new/util/update-grub.in
--- grub2-1.96+20080724/util/update-grub.in	2008-06-16 13:29:55.000000000 -0700
+++ grub2-1.96+20080724_new/util/update-grub.in	2008-08-19 23:43:12.000000000 -0700
@@ -111,6 +111,9 @@
 # choosing Hurd filesystem module.
 GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`"
 
+# Screen size for gfxterm and background image
+GRUB_GEOMETRY=640x480
+
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
 fi
@@ -149,10 +152,10 @@
 
 # These are defined in this script, export them here so that user can
 # override them.
-export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES
+export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES GRUB_GEOMETRY
 
 # These are optional, user-defined variables.
-export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID
+export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_AUTOGEN_IMAGE_DIR
 
 exec > ${grub_cfg}.new
 
--- grub2-1.96+20080724/debian/control	2008-08-19 23:33:17.000000000 -0700
+++ grub2-1.96+20080724_new/debian/control	2008-08-20 00:17:54.000000000 -0700
@@ -47,7 +47,7 @@
 Provides: grub
 Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1)
 Conflicts: pupa, grub, desktop-base (= 4.0.5)
-Suggests: desktop-base (>= 4.0.6), os-prober
+Suggests: desktop-base (>= 4.0.6), os-prober, librsvg2-bin
 Description: GRand Unified Bootloader, version 2 (PC/BIOS version)
  GRUB is a portable, powerful bootloader.  This version of GRUB is based on a
  cleaner design than its predecessors, and provides the following new features:

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to