Grub 1.98 include code in 00_header.in and grub-mkconfig.in to add
theme entries to /boot/grub.cfg, but it does not provide a similar
method for adding background images (wallpapers).

The patch included adds some lines just over GRUB_THEME entriens in
00_header.in to handle the background image.  It will also look for
the image format and insert the module required by it.

I got parts of this patch (code) from somewhere else, but can't remember from.
https://savannah.gnu.org/bugs/index.php?29252
diff -urN grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
--- grub-1.98.orig/util/grub.d/00_header.in	2010-03-10 20:30:56.319608325 -0400
+++ grub-1.98/util/grub.d/00_header.in	2010-03-10 23:01:20.856612701 -0400
@@ -104,6 +104,20 @@
     terminal gfxterm
   fi
 EOF
+if [ x$GRUB_BACKGROUND != x ] && [ -f $GRUB_BACKGROUND ] \
+	&& is_path_readable_by_grub $GRUB_BACKGROUND; then
+    echo "Found background: $GRUB_BACKGROUND" >&2
+    case $GRUB_BACKGROUND in 
+        *.png)         reader=png ;;
+        *.tga)         reader=tga ;;
+        *.jpg|*.jpeg)  reader=jpeg ;;
+    esac
+    prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_BACKGROUND` | sed -e "s/^/  /"
+    cat << EOF
+  insmod $reader
+  background_image (\$root)`make_system_path_relative_to_its_root $GRUB_BACKGROUND`
+EOF
+fi
 if [ x$GRUB_THEME != x ] && [ -f $GRUB_THEME ] \
 	&& is_path_readable_by_grub $GRUB_THEME; then
     echo "Found theme: $GRUB_THEME" >&2
diff -urN grub-1.98.orig/util/grub-mkconfig.in grub-1.98/util/grub-mkconfig.in
--- grub-1.98.orig/util/grub-mkconfig.in	2010-03-10 20:30:56.319608325 -0400
+++ grub-1.98/util/grub-mkconfig.in	2010-03-10 20:34:00.689582261 -0400
@@ -220,6 +220,7 @@
   GRUB_DISABLE_LINUX_UUID \
   GRUB_DISABLE_LINUX_RECOVERY \
   GRUB_GFXMODE \
+  GRUB_BACKGROUND \
   GRUB_THEME \
   GRUB_GFXPAYLOAD_LINUX \
   GRUB_DISABLE_OS_PROBER \
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to