Linux Grub2 background configuration woes!

Dark Star

Level H
Ok I started fiddling with grub2 as of now, and got almost everything under my hood :P Things are very much same except the annoying update script :P

Anyway I tried to set a Background for my grub2 loader. I did the following ..

1. Placed a jpg/png bg in the /usr/share/images/desktop-base

Code:
shashwat@shashwat-desktop:~$ ls /usr/share/images/desktop-base/

Linux.jpg  Lucid.png

shashwat@shashwat-desktop:~$

2. After that I edited /boot/grub.d/05_debian_theme scrpit and added the wallpaper entry, I even changed use_bg=true from use_bg=false

Code:
#!/bin/bash -e

source /usr/lib/grub/grub-mkconfig_lib

set_mono_theme()

{

  cat << EOF

set menu_color_normal=white/black

set menu_color_highlight=black/white

EOF

}

# check for usable backgrounds

use_bg=true

if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then

  for i in {/boot/grub,/usr/share/images/desktop-base}/Lucid.{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

      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=black/black

  set color_highlight=magenta/black

else

EOF

fi

# otherwise, set a monochromatic theme for Ubuntu

if ${use_bg} ; then

  set_mono_theme | sed -e "s/^/  /g"

  echo "fi"

else

  set_mono_theme

fi

3. Next I updated the grub using the loathsome update-grub command.

After reboot the grub is still plain black! What am I doing wrong here :@?

Please do shed some light.

Regards
 
Re: Grub2 bbackground configuration woes!

why did you change use_bg to false???

btw what is your GRUB screen resolution? make sure the image is exactly that size (not sure if the problem is still there), you do this by setting/uncommenting the GRUB_GFXMODE setting so its like GRUB_GFXMODE=1024x768 (i prefer that or i use my LCD native size 1920x1200)... this is in /etc/default/grub file, then rerun "sudo update-grub" after fixing use_gb set it back to true... (make sure the Lucid.png is also the matching size)

also, maybe the png is cauing issues, add jpg to the list in debian_theme like Lucid.{png,tga,jpg} and try that too :)

PS: great to see you are spending time on Lucid hehehe, are you going to surprise us with some neat customisations???

edit : oops just realised its Linux.jpg not Lucid.jpg... so make that portion in debian_theme like "Linux.jpg" or Linux.{png,tga,jpg} and see if it works, of course you can just convert the Lucid.png to Lucid.jpg of the matching size...
 
^^That didn't worked :( I changed the resolution to my screen reolution and re-run the update tool but nthing happened. :(

BTW I didn't changed it to bg_false. I have changed to bg=true from bg=false :P
 
Any particular reason of playing around with GRUB2?

I have sticked Grub Legacy because it does what its supposed - Boot the system. And it does that pretty well;)
 
@darky, please leave it as "use_bg=false" because the script itself will make it true if it locates a background.

Question: when you run "sudo update-grub" does it print this line like "Found background image: ... " ??? If not, then please revert ANY and ALL such custom/minor changes you made like "use_bg" etc. because if you see all the scripts inside /etc/grub.d/ folder they rely or many settings like GRUB_TERMINAL and GRUB_TERMINAL_OUTPUT some which should be set by user and some which are set automatically...

If you dont see "Found background image: ..." being displayed then some such problem is there...

In fact I suspect you are using non-Ubuntu grub2 because my /etc/grub.d/05_debian_theme just had a "WALLPAPER" variable which I have set and it works for me :)

If you still face problems please paste all the following files online at some pastebin site:

/etc/default/grub

all the scripts in /etc/grub.d...

output of "sudo update-grub" command...
 
I'm having grub2 Splashimage working in Ubuntu Karmic with a custom image on .tga format made using GIMP used(You can convert easily).grub2-splashimages package also contains various *.tga images.

First Try of the Splashimage showed a corrupted image.Later I switched to vga=775 Mode for My AOC 19" Widescreen Monitor after trial&error. I've appended "splash vga=775" set on the line " linux /boot/vmlinuz-2.6.31-17-generic root=UUID=1e905e44-2d6c-491d-9471-e11811ec01f7 ro splash vga=775 " to work correctly in the file /boot/grub.cfg .You may be able to add "splash vga=xyz" value via "sudo dpkg-reconfigure grub-pc" IIRC ? .
You can find Vga Modes Here :
AntLinux Wiki - HowTos/VgaModes

And /etc/grub.d/05_debian_theme of Mine looks like below:

Code:
  for i in {/boot/grub,/usr/share/images/desktop-base}/lazydays.{png,tga} ; do

G'luck.
 
I'm facing a problem with Grub2 background.

My image is placed in /usr/share/images/desktop-base.

I have edited /etc/grub.d/05_debian_theme to look like this (I'm using Grub 1.98)

WALLPAPER="/usr/share/images/desktop-base/stonehenge.jpg"

I have edited /etc/default/grub

GRUB_GFXMODE=1440x900

My image is 1440x900.

When I update-grub, I get the message as well.

Found background image: stonehenge.jpg

When I boot up, Grub is displayed at 1440x900 resolution, but I don't see the image. :(

I feel I've missed a little thing, but dunno. :S

UPDATE: Meh, using a png image instead of jpg worked. :P
 
Back
Top