From: Schantl Stefan Date: Mon, 25 Oct 2010 18:11:10 +0000 (+0200) Subject: grub: Add theme file and splash backround. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd2bcd3980f00d76e0ff2039170ab85a23891c5a;p=ipfire-3.x.git grub: Add theme file and splash backround. Fixes #79. --- diff --git a/pkgs/core/grub/05_theme b/pkgs/core/grub/05_theme new file mode 100644 index 000000000..0d2bd16be --- /dev/null +++ b/pkgs/core/grub/05_theme @@ -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 diff --git a/pkgs/core/grub/grub.nm b/pkgs/core/grub/grub.nm index b965d865f..99892b14e 100644 --- a/pkgs/core/grub/grub.nm +++ b/pkgs/core/grub/grub.nm @@ -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 index 000000000..44cd6e156 Binary files /dev/null and b/pkgs/core/grub/splash.png differ