tag 608519 - wontfix tag 608519 + patch Dear GRUB maintainers,
Now that squeeze is released, I'd like to clean up some code. Please include the attached patch in the next upload. Detailed description follows: * 05_debian_theme: - Small cosmetic fix. - Make the file extension code case insensitive (addresses: #611123). - Remove the code deleting obsolete background images from /boot/grub. It was added on 2010-12-18 and is included in squeeze, so we can assume that almost everybody had their /boot/grub/ cleaned up meanwhile. Remove the code as it can cause problems under some circumstances (closes: #608519). - Simply try all files under /boot/grub/ when searching for a background image instead of duplicating the list of supported file extensions. * postinst: - Simplify the code which was formerly responsible for copying the background image to /boot/grub/. I should have done this when fixing #605705 but I wanted to keep the patch small. * postrm: - Remove the code which deletes moreblue-orbit-grub.png from /boot/grub/. Since the 05_debian_theme already did that (see above), that is not necessary any more (closes: #608519). Best regards Alexander Kurtz
diff -Naur grub2-1.99~rc1.orig/debian/grub.d/05_debian_theme grub2-1.99~rc1/debian/grub.d/05_debian_theme --- grub2-1.99~rc1.orig/debian/grub.d/05_debian_theme 2011-02-08 14:10:00.000000000 +0100 +++ grub2-1.99~rc1/debian/grub.d/05_debian_theme 2011-02-08 14:28:19.251806957 +0100 @@ -37,7 +37,7 @@ # Step #1: Search all available output modes ... local output for output in ${GRUB_TERMINAL_OUTPUT}; do - if [ "x$output" = "xgfxterm" ]; then + if [ "x${output}" = "xgfxterm" ]; then break fi done @@ -55,9 +55,9 @@ # Step #3: Search the correct GRUB module for our background image. local reader case "${1}" in - *.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";; - *.png|*.PNG) reader="png";; - *.tga|*.TGA) reader="tga";; + *.[jJ][pP][gG]|*.[jJ][pP][eE][gG]) reader="jpeg";; + *.[pP][nN][gG]) reader="png";; + *.[tT][gG][aA]) reader="tga";; *) return 3;; # Unknown image type. esac @@ -106,24 +106,6 @@ echo "fi" } -# Earlier versions of grub-pc copied the default background image to /boot/grub -# during postinst. Remove those obsolete images if they haven't been touched by -# the user. They are still available under /usr/share/images/desktop-base/ if -# desktop-base is installed. -while read checksum background; do - if [ -f "${background}" ] && [ "x`sha1sum "${background}"`" = "x${checksum} ${background}" ]; then - echo "Removing old background image: ${background}" >&2 - rm "${background}" - fi -done <<EOF -648ee65dd0c157a69b019a5372cbcfea4fc754a5 debian-blueish-wallpaper-640x480.png -0431e97a6c661084c59676c4baeeb8c2f602edb8 debian-blueish-wallpaper-640x480.png -968ecf6696c5638cfe80e8e70aba239526270864 debian-blueish-wallpaper-640x480.tga -11143e8c92a073401de0b0fd42d0c052af4ccd9b moreblue-orbit-grub.png -d00d5e505ab63f2d53fa880bfac447e2d3bb197c moreblue-orbit-grub.png -f5b12c1009ec0a3b029185f6b66cd0d7e5611019 moreblue-orbit-grub.png -EOF - # Include the configuration of desktop-base if available. if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then . "/usr/share/desktop-base/grub_background.sh" @@ -138,7 +120,7 @@ fi # Next search for pictures the user put into /boot/grub/ and use the first one. -for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do +for background in *; do if set_background_image "${background}"; then exit 0 fi diff -Naur grub2-1.99~rc1.orig/debian/postinst.in grub2-1.99~rc1/debian/postinst.in --- grub2-1.99~rc1.orig/debian/postinst.in 2011-02-08 14:10:00.000000000 +0100 +++ grub2-1.99~rc1/debian/postinst.in 2011-02-08 14:52:28.519210330 +0100 @@ -587,11 +587,7 @@ # /boot/grub/ has more chances of being accessible by GRUB if test -e /boot/grub/grub.cfg ; then - for i in /usr/share/grub/unicode.pf2 ; do - if test -e $i ; then - cp $i /boot/grub/ - fi - done + cp /usr/share/grub/unicode.pf2 /boot/grub/ fi if [ "$fix_mixed_system" ]; then diff -Naur grub2-1.99~rc1.orig/debian/postrm.in grub2-1.99~rc1/debian/postrm.in --- grub2-1.99~rc1.orig/debian/postrm.in 2011-02-08 14:10:00.000000000 +0100 +++ grub2-1.99~rc1/debian/postrm.in 2011-02-08 14:18:24.904816293 +0100 @@ -23,7 +23,7 @@ db_go || true db_get grub-pc/postrm_purge_boot_grub || true if [ "$RET" = "true" ] ; then - rm -f /boot/grub/{grub.cfg,ascii.pf2,unicode.pf2,moreblue-orbit-grub.png,*.mod,*.lst,*.img,efiemu32.o,efiemu64.o,device.map,grubenv,installed-version,.background_cache.jpeg,.background_cache.png,.background_cache.tga} || true + rm -f /boot/grub/{grub.cfg,ascii.pf2,unicode.pf2,*.mod,*.lst,*.img,efiemu32.o,efiemu64.o,device.map,grubenv,installed-version,.background_cache.jpeg,.background_cache.png,.background_cache.tga} || true rm -rf /boot/grub/locale rmdir --ignore-fail-on-non-empty /boot/grub || true fi
signature.asc
Description: This is a digitally signed message part