diff -Nur e-smith-grub-2.6.0.old/createlinks e-smith-grub-2.6.0/createlinks --- e-smith-grub-2.6.0.old/createlinks 2008-10-07 19:35:43.000000000 +0200 +++ e-smith-grub-2.6.0/createlinks 2016-06-13 10:29:32.389234506 +0200 @@ -2,9 +2,24 @@ use esmith::Build::CreateLinks qw(:all); -templates2events("/boot/grub/grub.conf", - qw( - local - post-install - post-upgrade - )); + +# templates to expand + for my $event (qw( + local + post-install + post-upgrade + )) + { + event_templates ($event , "/etc/sysconfig/kernel"); + event_templates ($event , "/etc/default/grub"); + } + +# actions to perform + for my $event (qw( + local + post-install + post-upgrade + )) + { + event_actions ( $event , 'update-grub'=>'10'); + } diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/events/actions/update-grub e-smith-grub-2.6.0/root/etc/e-smith/events/actions/update-grub --- e-smith-grub-2.6.0.old/root/etc/e-smith/events/actions/update-grub 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/events/actions/update-grub 2016-06-13 10:29:32.389234506 +0200 @@ -0,0 +1,5 @@ +#!/usr/bin/perl +use strict; +use warnings; + system("grub2-mkconfig","-o","/boot/grub2/grub.cfg") == 0 + or die("Unable to update grub2\n"); diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/FixRoot e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/FixRoot --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/FixRoot 2006-03-16 07:34:15.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/FixRoot 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -{ - @lines = map { s/root \(hd1,0\)/root (hd0,0)/ ; $_ } @lines; - $OUT = ""; -} - diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/FixTitle e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/FixTitle --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/FixTitle 2016-02-05 23:58:49.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/FixTitle 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -{ - # Remove /etc/motd content which accidentaly was put in grub.cfg - # during kernel upgrades, see BZ 9161 - my @bad_lines = ( - qr{^Before editing configuration files, familiarise$}, - qr{^yourself with the automated events and templates$}, - qr{^systems\.$}, - qr{^Please take the time to read the documentation$}, - qr{^http://wiki.contribs.org/Main_Page$}, - qr{^Remember that SME Server is free to download$}, - qr{^and use, but it is not free to build$}, - qr{^Please help the project :$}, - qr{^http://wiki.contribs.org/Donate}, - qr{^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \(\d[\.\d\-]*\.el6\.(x86_64|i[3-5]86)\)$} - ); - my $title_re = qr{^title \*\*\*\*\*\*\*\*\*\*\*\* Welcome to SME Server 9\.[01] \*\*\*\*\*\*\*\*\*\*\*\*\*$}; - my @new_lines = (); - foreach my $l (@lines){ - my $match = 0; - foreach (@bad_lines){ - if ($l =~ m/$_/){ - $match = 1; - last; - } - } - push @new_lines, $l unless ($match); - } - @lines = @new_lines; - @lines = map { s/$title_re/title SME Server $sysconfig{ReleaseVersion}/; $_ } @lines; - $OUT = ''; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/hiddenmenu e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/hiddenmenu --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/hiddenmenu 2013-01-31 22:31:36.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/hiddenmenu 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -{ - @lines = map { s/^hiddenmenu$// ; $_ } @lines; - $OUT = ""; -} - diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/RemovePlymouth e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/RemovePlymouth --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/RemovePlymouth 2016-02-05 23:58:49.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/RemovePlymouth 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -{ - @lines = map { s/ro root/ro rd_NO_PLYMOUTH root/; $_ } @lines; - $OUT = ""; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/template-begin e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/template-begin --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/template-begin 2006-03-16 07:34:15.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/template-begin 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -{ - if (open(GRUB, "/boot/grub/grub.conf")) - { - @lines = ; - } - close GRUB; - $OUT = ""; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/template-end e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/template-end --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/template-end 2006-03-16 07:34:15.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/template-end 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -{ - foreach (@lines) - { - $OUT .= "$_\n"; - } -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateCentOS e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateCentOS --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateCentOS 2008-10-07 19:35:43.000000000 +0200 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateCentOS 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -{ - @lines = map { s/^title CentOS/title SME Server/; $_ } @lines; - $OUT = ""; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateDefault e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateDefault --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateDefault 2006-03-16 07:34:15.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateDefault 1970-01-01 01:00:00.000000000 +0100 @@ -1,28 +0,0 @@ -{ - return "" unless (defined $EVENT and $EVENT eq "local"); - - open (VERSION, "/proc/version") or die "Couldn't read /proc/version"; - my $version = ; - chomp $version; - $version =~ s/^Linux version ([^\s]+) .*/$1/; - close VERSION; - - $default_index = 0; - foreach (@lines) - { - $default_index=$1 if /^default=(\d+)/; - } - - my $i = 0; - foreach $kernel (grep { /^[^#]*kernel\s+.*vmlinuz/ } @lines) - { - if ($kernel =~ /vmlinuz-$version\s/) - { - $default_index=$i; - last; - } - $i++; - } - @lines = map { s/default=\d+/default=$default_index/; $_ } @lines; - $OUT = ""; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateSplash e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateSplash --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateSplash 2008-10-07 19:35:43.000000000 +0200 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/boot/grub/grub.conf/UpdateSplash 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -{ - our @newlines; - foreach( @lines ) { - next if /^foreground/ || /^background/; - if ( m#^splashimage=(.*)/# ) { - push @newlines, "splashimage=$1/smeserver.xpm.gz"; - push @newlines, "foreground 000000"; - push @newlines, "background 4E95D3"; - } else { - push @newlines, $_; - } - } - @lines = @newlines; - $OUT = ""; -} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/DisableConsole e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/DisableConsole --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/DisableConsole 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/DisableConsole 2016-06-13 10:32:34.839167425 +0200 @@ -0,0 +1,4 @@ +{ + @lines = map { s/GRUB_TERMINAL_OUTPUT="console"/GRUB_TERMINAL_OUTPUT="gfxterm"/; $_ } @lines; + $OUT = ""; +} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/EnableRecovery e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/EnableRecovery --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/EnableRecovery 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/EnableRecovery 2016-06-13 10:29:32.390234506 +0200 @@ -0,0 +1,4 @@ +{ + @lines = map { s/GRUB_DISABLE_RECOVERY="true"/GRUB_DISABLE_RECOVERY="false"/; $_ } @lines; + $OUT = ""; +} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/GrubSplash e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/GrubSplash --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/GrubSplash 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/GrubSplash 2016-06-13 10:33:26.757148361 +0200 @@ -0,0 +1,5 @@ +{ + push @lines, 'GRUB_BACKGROUND="/boot/grub/smeserver10.png"' unless ( grep /GRUB_BACKGROUND/, @lines ); + push @lines, 'GRUB_GFXMODE="640x480"' unless ( grep /GRUB_GFXMODE/, @lines ); + $OUT = ""; +} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/template-begin e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/template-begin --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/template-begin 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/template-begin 2016-06-13 10:29:32.391234505 +0200 @@ -0,0 +1,8 @@ +{ + if (open(GRUB, "/etc/default/grub")) + { + @lines = ; + } + close GRUB; + $OUT = ""; +} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/template-end e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/template-end --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates/etc/default/grub/template-end 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates/etc/default/grub/template-end 2016-06-13 10:29:32.391234505 +0200 @@ -0,0 +1,6 @@ +{ + foreach (@lines) + { + $OUT .= "$_\n"; + } +} diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates.metadata/boot/grub/grub.conf e-smith-grub-2.6.0/root/etc/e-smith/templates.metadata/boot/grub/grub.conf --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates.metadata/boot/grub/grub.conf 2006-03-16 07:34:15.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates.metadata/boot/grub/grub.conf 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -FILTER=sub { $_[0] =~ /^\s*$/ ? '' : $_[0] } diff -Nur e-smith-grub-2.6.0.old/root/etc/e-smith/templates.metadata/etc/default/grub e-smith-grub-2.6.0/root/etc/e-smith/templates.metadata/etc/default/grub --- e-smith-grub-2.6.0.old/root/etc/e-smith/templates.metadata/etc/default/grub 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-grub-2.6.0/root/etc/e-smith/templates.metadata/etc/default/grub 2016-06-13 10:29:32.391234505 +0200 @@ -0,0 +1 @@ +FILTER=sub { $_[0] =~ /^\s*$/ ? '' : $_[0] }