Bug#560978: Boot menu visible on only part of the screen when GFXMODE is set

Frank Lin PIAT fpiat at klabs.be
Tue Jan 5 22:03:22 UTC 2010


Package: grub-pc
Version: 1.98~20100101-1
Severity: normal

Assuming that the background image provided is a .svg, I have added the
following snippet in /etc/grub.d/05_debian_theme to convert the svg into
and png at the resolution specified GRUB_GFXMODE.

This snippets certainly needs some improvements/a better integration
with grub.

Franklin

# Convert .svg files
case $WALLPAPER in
	*.svg)
	svgfmt=$(echo $GRUB_GFXMODE | sed -n -e 's/^\(\w*\)x\(\w*\)$/-w \1 -h \2/p')

	[ ! "$svgfmt" ] && svgfmt="-w 640 -h 480"
	if which rsvg-convert > /dev/null; then
		rsvg-convert -f png $svgfmt $WALLPAPER -o /boot/grub/auto-converted.png
		WALLPAPER=/boot/grub/auto-converted.png
	fi
	;;
esac



### BEGIN /etc/grub.d/05_debian_theme ###
#!/bin/bash -e

source /usr/lib/grub/grub-mkconfig_lib

# this allows desktop-base to override our settings
f=/usr/share/desktop-base/grub_background.sh
if test -e ${f} ; then
  source ${f}
else
#  WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-grub.png"
  WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-wallpaper.svg"
  COLOR_NORMAL="black/black"
  COLOR_HIGHLIGHT="magenta/black"
fi

set_blue_theme()
{
  cat << EOF
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
EOF
}

# Convert .svg files
case $WALLPAPER in
	*.svg)
	svgfmt=$(echo $GRUB_GFXMODE | sed -n -e 's/^\(\w*\)x\(\w*\)$/-w \1 -h \2/p')

	[ ! "$svgfmt" ] && svgfmt="-w 640 -h 480"
	if which rsvg-convert > /dev/null; then
		rsvg-convert -f png $svgfmt $WALLPAPER -o /boot/grub/auto-converted.png
		WALLPAPER=/boot/grub/auto-converted.png
	fi
	;;
esac

# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
  for i in /boot/grub/`basename ${WALLPAPER}` ${WALLPAPER} ; 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 background image: `basename ${bg}`" >&2
        use_bg=true
        break
      fi
    fi
  done
fi

# set the background if possible
if ${use_bg} ; then
  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
  cat << EOF
insmod ${reader}
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
  set color_normal=${COLOR_NORMAL}
  set color_highlight=${COLOR_HIGHLIGHT}
else
EOF
fi

# otherwise, set the traditional Debian blue theme
if ${use_bg} ; then
  set_blue_theme | sed -e "s/^/  /g"
  echo "fi"
else
  set_blue_theme
fi
### END /etc/grub.d/05_debian_theme ###

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (101, 'unstable'), (10, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]    1.5.28          Debian configuration management sy
ii  grub-common              1.98~20100101-1 GRand Unified Bootloader, version 
ii  libc6                    2.10.2-2        GNU C Library: Shared libraries
ii  ucf                      3.0025          Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  5.0.5      common files for the Debian Deskto

-- debconf-show failed





More information about the Pkg-grub-devel mailing list