diff -Nur e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubSplash e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubSplash --- e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubSplash 2016-06-15 22:30:29.000000000 +0200 +++ e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubSplash 2017-05-11 01:46:40.803368900 +0200 @@ -1,4 +1,26 @@ { - push @lines, 'GRUB_BACKGROUND="/boot/grub/smeserver10.png"' unless ( grep /GRUB_BACKGROUND/, @lines ); + # grub splash image for koozali, alternative to theme + # ignored if a theme is defined + #GRUB_BACKGROUND="/boot/grub2/smeserver10.png" + my $GrubBackground= $Sysconfig{'GrubBackground'} || '/boot/grub2/smeserver10.png'; + # remove if disabled, : you do not want any background + if ($GrubBackground eq 'disabled') { + @lines = map { + s/^GRUB_BACKGROUND.*//; + $_ + } @lines; + } + else { + + # change if line already there + @lines = map { + /^GRUB_BACKGROUND/ && ! /="$GrubBackground"/ && s/=".*"/="$GrubBackground"/; + $_ + } @lines; + + # add if line missing + push @lines, 'GRUB_BACKGROUND="$GrubBackground"' unless ( grep /GRUB_BACKGROUND/, @lines ); + } $OUT = ""; + } diff -Nur e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubTheme e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubTheme --- e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubTheme 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubTheme 2017-05-11 01:38:40.416370912 +0200 @@ -0,0 +1,31 @@ +{ + # grub theme for koozali: + #GRUB_THEME="/boot/grub2/themes/koozali/theme.txt" + #GRUB_GFXMODE="1024x768" + my $GrubTheme = $Sysconfig{'GrubTheme'} || 'koozali'; + my $GrubGFXMODE = $Sysconfig{'GrubGFXMODE'} || '1024x768'; + + # remove if disabled + if ($GrubTheme eq 'disabled') { + @lines = map { + s/^GRUB_GFXMODE.*//; + s/^GRUB_THEME.*//; + $_ + } @lines; + } + else { + + # change if line already there + @lines = map { + /^GRUB_GFXMODE/ && ! /="$GrubGFXMODE"/ && s/=".*"/="$GrubGFXMODE"/; + /^GRUB_THEME/ && ! /="\/boot\/grub2\/themes\/$GrubTheme\/theme.txt"/ && s/=".*"/="\/boot\/grub2\/themes\/$GrubTheme\/theme.txt"/; + $_ + } @lines; + + # add if line missing + push @lines, 'GRUB_GFXMODE="'.$GrubGFXMODE.'"' unless ( grep /GRUB_GFXMODE/, @lines ); + push @lines, 'GRUB_THEME="/boot/grub2/themes/'.$GrubTheme.'/theme.txt"' unless ( grep /GRUB_THEME/, @lines ); + } + ""; +} +