Re: Grub 2 Basics
Originally Posted by
ghostier
I've got the resolution to work. I've also edited the 05_debian_theme correctly (update-grub finds the correct image file) however the image still does not appear for me. I was wondering if "use_bg = false" should be "use_bg = true" because right now both instances that call "use_bg =" is "use_bg = true" I was wondering if that messed up the loops within the code.
Edit: Just tried it after setting the first "use_bg = true" to "use_bg = false". This is the one right before the for loop where we enter the image file name and directory. No dice. I don't think its the "use_bg"
Mine works fine like this:
Code:
#!/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/menu.png"
COLOR_NORMAL="white/black"
COLOR_HIGHLIGHT="black/white"
fi
set_mono_theme()
{
cat << EOF
set menu_color_normal=black/black
set menu_color_highlight=red/white
EOF
}
# 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 a monochromatic theme for Ubuntu
if ${use_bg} ; then
set_mono_theme | sed -e "s/^/ /g"
echo "fi"
else
set_mono_theme
fi
I am wondering if you downloaded the images package and if that is screwing with it. The default file is /usr/share/images/desktop-base (there is a package called desktop-base that will give you the image called for by default if you like people to think that you are booting Debian).
I believe the "bg=false" is in reference to not finding the image.
If you have the images package installed leave the selected image in the .../images/grub file but copy it to the .../images/desktop-base file too.
I had to do that early on in 9.10-testing but I thought that was ironed out back then. Might be worth a try.
I never liked the images anyway so I edit my own with gimp and just put them in the desktop-base file with, as you can see, complex names.
Dell 480 XPS 3G ram Quad Core 2.40GHz, Radeon HD 2400 PRO, Audigy1, 3x320G HDD, 320G External, Debian Testing for use, Debian Squeeze for secure use, Debian Sid for FUN
Bookmarks