Skip to contentSkip to conversation

grub2 doesn't parse .jpeg files

DISCUSSION shirish 4 participants 4 messages Feb 26, 2008 – Feb 28, 2008

lore
Share & tools
lore

shirish

author
#0 lore raw
Quoted 23 lines

Message: 5
Date: Mon, 25 Feb 2008 21:53:19 +0800
From: Bean <[email protected]>
Subject: Re: grub2 doesn't parse .jpeg files
To: "The development of GRUB 2" <[email protected]> Message-ID:

        <[email protected]>

Content-Type: text/plain; charset=ISO-8859-1

Quoted 11 lines · shirish

Hi all,

          I'm using grub 1.96+20080203-1ubuntu1 . Now in the directory

/usr/share/images/desktop-base/ there are quite few images which are there. While some of the images work some didn't . Especially the .jpg/,jpeg files. (I don't remember which extension it was for I'm on a different machine atm. )
Another thing can one have any stuff from deviantart.com or
openclipart.org which is .png & has the required resolution or not? I just have to add it to the path & that's it or something else also has to be done?
--

Quoted 6 lines

Please upload the ones that doesn't work.

--
Bean

------------------------------

Hi all,
I think I know why the .jpg & the .svg files don't work. This is the
section of /boot/grub/grub.cfg

### BEGIN /etc/grub.d/05_debian_theme ###
insmod png
if background_image (hd0,1)/usr/share/images/desktop-base/debblue-1600x1200.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 ###

And there is a module called png.mod

shirish@Mugglewille:~$ ll -h /boot/grub/png.mod
-rw-r--r-- 1 root root 6.1K 2008-02-09 20:01 /boot/grub/png.mod

I'm guessing this is the reason those are parsed while others are not. And I can see all the other images in the browser. Maybe there needs to be svg.mod & jpg.mod . There are no modules with this name in the /boot/grub/ directory.

Signature · 5 lines
          Regards,
          Shirish Agarwal
  This email is licensed under http://creativecommons.org/licenses/by-nc/3.0/

065C 6D79 A68C E7EA 52B3  8D70 950D 53FB 729A 8B17
#1 lore raw

Quoting shirish <[email protected]>:

Quoted 4 lines

I'm guessing this is the reason those are parsed while others are not. And I can see all the other images in the browser. Maybe there needs to be svg.mod & jpg.mod . There are no modules with this name in the /boot/grub/ directory.

jpeg.mod is there, and it needs to be loaded for JPEG files. SVG is not supported yet, I believe.

Signature · 2 lines
Regards,
Pavel Roskin
#2 lore raw
Quoted 9 lines · Pavel Roskin

Quoting shirish <[email protected]>:

Quoted 4 lines

I'm guessing this is the reason those are parsed while others are not. And I can see all the other images in the browser. Maybe there needs to be svg.mod & jpg.mod . There are no modules with this name in the /boot/grub/ directory.

jpeg.mod is there, and it needs to be loaded for JPEG files. SVG is not supported yet, I believe.

Known problem. Next 05_debian_theme will be improved to correct this.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
#3 lore raw
In reply to shirish

Hi there!

Quoted 7 lines · shirish

I think I know why the .jpg & the .svg files don't work. This is the
section of /boot/grub/grub.cfg

### BEGIN /etc/grub.d/05_debian_theme ###
insmod png
if background_image (hd0,1)/usr/share/images/desktop-base/debblue-1600x1200.png ; then

It seems that you've modified the stock /etc/grub.d/05_debian_theme [1]:

--8<---------------cut here---------------start------------->8---

# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL" = "gfxterm" ] ; then
  for i in {/usr/share/images/desktop-base,/boot/grub}/debian-blueish-wallpaper-640x480.{png,tga} ; do
    if bg=`convert_system_path_to_grub_path $i` ; then
      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
fi
--8<---------------cut here---------------end--------------->8---

Since the check is only performed for a specific image either in png or tga format, jpg images are not taken into account.

Yesterday night I worked on a solution which enables something more configurable, but I haven't had time to submit upstream yet.

Thx, bye,
Gismo / Luca

Footnotes:
[1] http://svn.debian.org/wsvn/pkg-grub/grub2/trunk/debian/grub.d/05_debian_theme?op=file&rev=689&sc=0