]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
grub: Add theme file and splash backround.
authorSchantl Stefan <Stevee@ipfire.org>
Mon, 25 Oct 2010 18:11:10 +0000 (20:11 +0200)
committerSchantl Stefan <Stevee@ipfire.org>
Mon, 25 Oct 2010 18:21:47 +0000 (20:21 +0200)
Fixes #79.

pkgs/core/grub/05_theme [new file with mode: 0644]
pkgs/core/grub/grub.nm
pkgs/core/grub/splash.png [new file with mode: 0644]

diff --git a/pkgs/core/grub/05_theme b/pkgs/core/grub/05_theme
new file mode 100644 (file)
index 0000000..0d2bd16
--- /dev/null
@@ -0,0 +1,52 @@
+#!/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=false
+if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
+for i in {/boot/grub,/usr/share/images/desktop-base}/splash.{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 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 IPFire
+if ${use_bg} ; then
+set_mono_theme | sed -e "s/^/ /g"
+echo "fi"
+else
+set_mono_theme
+fi
index b965d865fc29aeeb93bc6cc86256290479181d7e..99892b14e1282616029beeb91bdcd7a34d1fa6cc 100644 (file)
@@ -26,7 +26,7 @@ include $(PKGROOT)/Include
 
 PKG_NAME       = grub
 PKG_VER        = 1.98
-PKG_REL        = 1
+PKG_REL        = 2
 
 PKG_MAINTAINER =
 PKG_GROUP      = System/Boot
@@ -66,9 +66,16 @@ define STAGE_INSTALL
 
        sed -e "s/pkgdatadir/pkglibdir/g" -i $(BUILDROOT)/usr/sbin/grub-install
 
+       -mkdir -pv $(BUILDROOT)/boot/grub
+
+       # Install theme file
+       install -m 0744 $(DIR_SOURCE)/05_theme $(BUILDROOT)/etc/grub.d/ 
+
+       # Install splash background
+       install $(DIR_SOURCE)/splash.png $(BUILDROOT)/boot/grub
+
        # XXX - We will have to do this after the installation of the package by pakfire
        # Generate grub compatible font for graphical boot menu
-       -mkdir -pv $(BUILDROOT)/boot/grub
        # This only converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters
        $(BUILDROOT)/usr/bin/grub-mkfont --output=$(BUILDROOT)/boot/grub/unifont.pf2 \
                --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f /usr/share/X11/fonts/misc/unifont.pcf.gz
diff --git a/pkgs/core/grub/splash.png b/pkgs/core/grub/splash.png
new file mode 100644 (file)
index 0000000..44cd6e1
Binary files /dev/null and b/pkgs/core/grub/splash.png differ