Hello community,
here is the log from the commit of package kiwi for openSUSE:Factory checked in at 2014-06-08 13:36:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kiwi (Old)
and /work/SRC/openSUSE:Factory/.kiwi.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kiwi"
Changes:
--------
--- /work/SRC/openSUSE:Factory/kiwi/kiwi.changes 2014-06-01 18:56:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kiwi.new/kiwi.changes 2014-06-08 13:37:08.000000000 +0200
@@ -1,0 +2,112 @@
+Fri Jun 6 12:07:46 CEST 2014 - ms@suse.de
+
+- v5.06.107 released
+
+-------------------------------------------------------------------
+Fri Jun 6 12:04:54 CEST 2014 - ms@suse.de
+
+- Fixed grub2 recovery setup
+ * Recovery menu entry was not populated to all config files
+
+-------------------------------------------------------------------
+Thu Jun 5 10:39:34 CEST 2014 - ms@suse.de
+
+- v5.06.106 released
+
+-------------------------------------------------------------------
+Thu Jun 5 10:00:40 CEST 2014 - ms@suse.de
+
+- Use menu.c32 for isolinux to display a text menu if no
+ graphics theme is available
+
+-------------------------------------------------------------------
+Wed Jun 4 16:40:49 CEST 2014 - ms@suse.de
+
+- Fixed bundle-build result for vagrant image results
+
+-------------------------------------------------------------------
+Wed Jun 4 16:14:01 CEST 2014 - ms@suse.de
+
+- Follow up change for --bundle-build command
+ Make sure the build metadata files .packages/.verified/.channel
+ are part of the bundle
+
+-------------------------------------------------------------------
+Wed Jun 4 14:54:16 CEST 2014 - ms@suse.de
+
+- Fixed typo, surplus status flag
+
+-------------------------------------------------------------------
+Tue Jun 3 19:52:38 CEST 2014 - ms@suse.de
+
+- Follow up patch for KIWICollect::indexOfArray
+ * follow coding style and conventions
+
+-------------------------------------------------------------------
+Tue Jun 3 19:44:44 CEST 2014 - ms@suse.de
+
+- Added new class KIWIResult and command:
+
+ kiwi --bundle-build <build-number> --dest-dir <dir>
+
+ Along with the new KIWIResult class the above command was added.
+ With bundle-build and the given build number and build target
+ directory kiwi takes the information from the build target
+ directory and bundles the user relevant image files as single
+ files and/or tarball suitable for publishing.
+
+-------------------------------------------------------------------
+Tue Jun 3 16:33:52 CEST 2014 - adrian@suse.de
+
+- KIWICollect: fix order of architectures if one repository contains multiple architecture
+ versions of same rpm.
+
+-------------------------------------------------------------------
+Tue Jun 3 10:42:39 CEST 2014 - ms@suse.de
+
+- Write a kiwi.buildinfo file for each build
+ The buildinfo file contains information about the build which
+ will be used to collect user relevant image files according
+ to the requested image type and parameters. The result of a
+ kiwi build could contain intermediate build results which
+ will be embedded in the final result and stay in the result
+ directory in order to allow faster rebuilds. There will be
+ a new kiwi post processing command which collects only the
+ important result image files and provide them together with
+ a build number.
+
+-------------------------------------------------------------------
+Mon Jun 2 16:05:38 CEST 2014 - ms@suse.de
+
+- In preparation to support enable/disable of boot partition
+ + remove obsolete boot_id/root_id code from grub2 codebase
+ for grub2 we don't search via id, we search either by uuid
+ or by flag file
+ + for other bootloaders make sure boot_id is set to the root
+ partition id if no explicit boot partition exists
+
+-------------------------------------------------------------------
+Mon Jun 2 10:40:31 CEST 2014 - ms@suse.de
+
+- v5.06.105 released
+
+-------------------------------------------------------------------
+Mon Jun 2 10:17:48 CEST 2014 - ms@suse.de
+
+- Make sure the selected build type is used in upgrade mode.
+ With the wrong build type this could lead to unneeded
+ runtime checks called and failing (bnc #880744)
+
+-------------------------------------------------------------------
+Mon Jun 2 10:01:51 CEST 2014 - ms@suse.de
+
+- Fixed spec file, kiwi-templates contains arch specific
+ templates thus it's wrong to make this a noarch package
+
+-------------------------------------------------------------------
+Mon Jun 2 09:40:58 CEST 2014 - ms@suse.de
+
+- Fixed grub.conf setup for RHEL systems using legacy grub
+ on RHEL grub.conf is a link to the menu.lst file
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.K5mrob/_old 2014-06-08 13:37:09.000000000 +0200
+++ /var/tmp/diff_new_pack.K5mrob/_new 2014-06-08 13:37:09.000000000 +0200
@@ -26,7 +26,7 @@
Group: System/Management
Url: http://github.com/openSUSE/kiwi
Name: kiwi
-Version: 5.06.104
+Version: 5.06.107
Release: 0
Provides: kiwi-schema = 6.1
# requirements to build packages
@@ -432,9 +432,6 @@
Group: System/Management
PreReq: coreutils
Requires: kiwi-desc-vmxboot = %{version}
-%if 0%{?suse_version} > 1120
-BuildArch: noarch
-%endif
%description -n kiwi-templates
This package contains system image templates to easily build
@@ -592,7 +589,7 @@
%post -n kiwi-templates
#============================================================
# Clean up old old template directories if the exists
-oldDists=( 10.1 10.2 10.3 11.0 11.1 11.2 )
+oldDists=( 10.1 10.2 10.3 11.0 11.1 11.2 11.3 12.1 SLE10 SLED10 )
for dist in ${oldDists[@]};do
rm -rf /usr/share/kiwi/image/suse-$dist-JeOS
done
++++++ kiwi-docu.tar.bz2 ++++++
/work/SRC/openSUSE:Factory/kiwi/kiwi-docu.tar.bz2 /work/SRC/openSUSE:Factory/.kiwi.new/kiwi-docu.tar.bz2 differ: char 11, line 1
++++++ kiwi-repo.tar.bz2 ++++++
++++++ kiwi.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.git-hooks/pre-commit new/kiwi/.git-hooks/pre-commit
--- old/kiwi/.git-hooks/pre-commit 2014-05-23 14:09:39.000000000 +0200
+++ new/kiwi/.git-hooks/pre-commit 2014-06-05 10:40:15.000000000 +0200
@@ -14,6 +14,7 @@
# The known Perl modules
my @kiwiModules = qw (
+ KIWIResult.pm
KIWIArchList.pm
KIWIArch.pm
KIWIBasePlugin.pm
@@ -203,6 +204,7 @@
# List of modules not clean to level 1 (brutal) of perlcritic
my @notClean1 = qw (
+ KIWIResult.pm
KIWIArchList.pm
KIWIArch.pm
KIWIBasePlugin.pm
@@ -392,6 +394,7 @@
# List of modules not clean to level 2 (cruel) of perlcritic
my @notClean2 = qw (
+ KIWIResult.pm
KIWIArchList.pm
KIWIArch.pm
KIWIBasePlugin.pm
@@ -463,6 +466,7 @@
# List of modules not clean to level 3 (harsh) of perlcritic
my @notClean3 = qw (
+ KIWIResult.pm
KIWIArchList.pm
KIWIBoot.pm
KIWICache.pm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision 2014-05-27 14:49:56.000000000 +0200
+++ new/kiwi/.revision 2014-06-05 10:40:15.000000000 +0200
@@ -1 +1 @@
-8f5fffd0d15c249cfdd0118f69764a60534c5155
+4c3310b1dd3af316dd6d4a87ad3a336c2d8a801f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/kiwi.pl new/kiwi/kiwi.pl
--- old/kiwi/kiwi.pl 2014-05-27 14:49:56.000000000 +0200
+++ new/kiwi/kiwi.pl 2014-06-05 10:40:15.000000000 +0200
@@ -56,6 +56,7 @@
use KIWILog;
use KIWIQX;
use KIWIRoot;
+use KIWIResult;
use KIWIRuntimeChecker;
use KIWIXML;
use KIWIXMLInfo;
@@ -138,6 +139,27 @@
KIWIQX::qxx ( "rm -f /etc/smart/channels/*" );
}
#========================================
+ # Bundle user relevant build results
+ #----------------------------------------
+ if ($cmdL->getOperationMode("bundle")) {
+ my $bundle = KIWIResult -> new (
+ $cmdL -> getOperationMode("bundle"),
+ $cmdL -> getImageTargetDir(),
+ $cmdL -> getBuildNumber()
+ );
+ if (! $bundle) {
+ kiwiExit (1);
+ }
+ if (! $bundle -> buildRelease()) {
+ kiwiExit (1);
+ }
+ if (! $bundle -> populateRelease()) {
+ kiwiExit (1);
+ }
+ kiwiExit (0);
+ }
+
+ #========================================
# Prepare and Create in one step
#----------------------------------------
if ($cmdL->getOperationMode("build")) {
@@ -735,6 +757,8 @@
my $RootTree; # optional root tree destination
my $BootVMSystem; # system image to be copied on a VM disk
my $BootVMSize; # size of virtual disk
+ my $BundleBuild; # bundle user relevant build results
+ my $BundleID; # bundle/build id used in bundle-build
my $StripImage; # strip shared objects and binaries
my $PrebuiltBootImage; # dir. where a prepared boot image may be found
my $ISOCheck; # create checkmedia boot entry
@@ -768,6 +792,8 @@
"add-repoalias=s" => \@AddRepositoryAlias,
"add-repopriority=i" => \@AddRepositoryPriority,
"add-repotype=s" => \@AddRepositoryType,
+ "bundle-build=s" => \$BundleBuild,
+ "bundle-id=s" => \$BundleID,
"bootcd=s" => \$BootCD,
"bootusb=s" => \$BootUSB,
"bootvm=s" => \$BootVMDisk,
@@ -899,6 +925,12 @@
kiwiExit (1);
}
#========================================
+ # check if bundle-build option is set
+ #----------------------------------------
+ if (defined $BundleID) {
+ $cmdL -> setBuildNumber ($BundleID);
+ }
+ #========================================
# check if archive-image option is set
#----------------------------------------
if (defined $ArchiveImage) {
@@ -1284,6 +1316,9 @@
#========================================
# store operation modes
#----------------------------------------
+ if (defined $BundleBuild) {
+ $cmdL -> setOperationMode ("bundle",$BundleBuild);
+ }
if (defined $Build) {
$cmdL -> setOperationMode ("build",$Build);
}
@@ -1415,6 +1450,7 @@
#------------------------------------------
if (
(! defined $Build) &&
+ (! defined $BundleBuild) &&
(! defined $Prepare) &&
(! defined $Create) &&
(! defined $InitCache) &&
@@ -1495,6 +1531,16 @@
$kiwi -> failed ();
kiwiExit (1);
}
+ if ((defined $BundleBuild) && (! defined $Destination)) {
+ $kiwi -> error ("No destination directory specified");
+ $kiwi -> failed ();
+ kiwiExit (1);
+ }
+ if ((defined $BundleBuild) && (! defined $BundleID)) {
+ $kiwi -> error ("No bundle ID specified for bundle build");
+ $kiwi -> failed ();
+ kiwiExit (1);
+ }
return;
}
@@ -1549,6 +1595,10 @@
print " kiwi --test-image <image> --test-case <path>\n";
print " --type <image-type>\n";
print "\n";
+ print "Image bundle (user relevant files)\n";
+ print " kiwi --bundle-build <image-dest> --bundle-id <build-number>\n";
+ print " --dest-dir <dest-dir>\n";
+ print "\n";
print "Image Post Creation modes:\n";
print " kiwi --bootvm <initrd> --bootvm-system <systemImage>\n";
print " [ --bootvm-disksize <size> ]\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIBoot.pm new/kiwi/modules/KIWIBoot.pm
--- old/kiwi/modules/KIWIBoot.pm 2014-05-27 09:33:35.000000000 +0200
+++ new/kiwi/modules/KIWIBoot.pm 2014-06-05 10:40:15.000000000 +0200
@@ -3657,13 +3657,6 @@
$lib = 'lib64';
}
#==========================================
- # boot id in grub2 context
- #------------------------------------------
- my $boot_id = 1;
- if ($this->{partids}) {
- $boot_id = $this->{partids}{boot};
- }
- #==========================================
# Stage files
#------------------------------------------
$stages{bios}{initrd} = "'usr/lib/$grub_bios/$grubpc/*'";
@@ -4313,15 +4306,6 @@
#------------------------------------------
if ($loader eq "grub2") {
#==========================================
- # root/boot id's in grub2 context
- #------------------------------------------
- my $boot_id = 1;
- my $root_id = 1;
- if ($this->{partids}) {
- $boot_id = $this->{partids}{boot};
- $root_id = $this->{partids}{root};
- }
- #==========================================
# Theme and Fonts table
#------------------------------------------
my $theme = $xml -> getPreferences() -> getBootLoaderTheme();
@@ -4659,8 +4643,12 @@
# boot id in grub context
#------------------------------------------
my $boot_id = 0;
- if (($this->{partids}) && ($this->{partids}{boot})) {
- $boot_id = $this->{partids}{boot} - 1;
+ if ($this->{partids}) {
+ if ($this->{partids}{boot}) {
+ $boot_id = $this->{partids}{boot} - 1;
+ } elsif ($this->{partids}{root}) {
+ $boot_id = $this->{partids}{root} - 1;
+ }
}
#==========================================
# Create menu.lst file
@@ -4882,6 +4870,8 @@
} else {
print $FD "gfxboot bootlogo"."\n";
}
+ } else {
+ print $FD "ui menu.c32"."\n";
}
#==========================================
# Setup default title
@@ -5486,6 +5476,8 @@
$boot_id = $this->{partids}{installboot};
} elsif ($this->{partids}{boot}) {
$boot_id = $this->{partids}{boot};
+ } elsif ($this->{partids}{root}) {
+ $boot_id = $this->{partids}{root};
}
}
if ((! $this->{bindloop}) && (-b $diskname)) {
@@ -5633,8 +5625,12 @@
# re-init bootid, legacy grub starts at 0
#------------------------------------------
$boot_id = 0;
- if (($this->{partids}) && ($this->{partids}{boot})) {
- $boot_id = $this->{partids}{boot} - 1;
+ if ($this->{partids}) {
+ if ($this->{partids}{boot}) {
+ $boot_id = $this->{partids}{boot} - 1;
+ } elsif ($this->{partids}{root}) {
+ $boot_id = $this->{partids}{root} - 1;
+ }
}
#==========================================
# Clean loop maps
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWICollect.pm new/kiwi/modules/KIWICollect.pm
--- old/kiwi/modules/KIWICollect.pm 2014-05-23 14:09:40.000000000 +0200
+++ new/kiwi/modules/KIWICollect.pm 2014-06-05 10:40:15.000000000 +0200
@@ -987,6 +987,20 @@
}
#==========================================
+# indexOfArray
+#------------------------------------------
+sub indexOfArray {
+ my $element = shift;
+ my $array = shift;
+ my $count = 0;
+ foreach my $val(@$array) {
+ $count = $count + 1;
+ return $count if "$val" eq "$element";
+ }
+ return $count;
+}
+
+#==========================================
# setupPackageFiles
#------------------------------------------
sub setupPackageFiles {
@@ -1075,10 +1089,18 @@
if ($this->{m_debug} >= 5) {
$this->logMsg('I', " check architecture $arch ");
}
+ # sort keys 1st by repository order and secondary
+ # by architecture priority
PACKKEY:
for my $packKey( sort {
$poolPackages->{$a}->{priority}
<=> $poolPackages->{$b}->{priority}
+ || indexOfArray(
+ $poolPackages->{$a}->{arch}, \@fallbacklist
+ )
+ <=> indexOfArray(
+ $poolPackages->{$b}->{arch}, \@fallbacklist
+ )
} keys(%{$poolPackages})
) {
if ($this->{m_debug} >= 5) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWICommandLine.pm new/kiwi/modules/KIWICommandLine.pm
--- old/kiwi/modules/KIWICommandLine.pm 2014-05-23 14:09:40.000000000 +0200
+++ new/kiwi/modules/KIWICommandLine.pm 2014-06-05 10:40:15.000000000 +0200
@@ -817,6 +817,19 @@
}
#==========================================
+# setBuildNumber
+#------------------------------------------
+sub setBuildNumber {
+ # ...
+ # Store the build number used to bundle this build
+ # ---
+ my $this = shift;
+ my $build = shift;
+ $this->{buildNumber} = $build;
+ return 1;
+}
+
+#==========================================
# getSplashFile
#------------------------------------------
sub getInitrdFile {
@@ -825,6 +838,14 @@
}
#==========================================
+# getBuildNumber
+#------------------------------------------
+sub getBuildNumber {
+ my $this = shift;
+ return $this->{buildNumber};
+}
+
+#==========================================
# setSystemLocation
#------------------------------------------
sub setSystemLocation {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIConfig.sh new/kiwi/modules/KIWIConfig.sh
--- old/kiwi/modules/KIWIConfig.sh 2014-05-23 14:09:40.000000000 +0200
+++ new/kiwi/modules/KIWIConfig.sh 2014-06-05 10:40:15.000000000 +0200
@@ -1268,6 +1268,10 @@
elif [ -f /usr/share/syslinux/gfxboot.c32 ];then
mv /usr/share/syslinux/gfxboot.c32 /image/loader
fi
+ # add menu capabilities for non graphics boot
+ if [ -f /usr/share/syslinux/menu.c32 ];then
+ mv /usr/share/syslinux/menu.c32 /image/loader
+ fi
if [ -f /usr/share/syslinux/chain.c32 ];then
mv /usr/share/syslinux/chain.c32 /image/loader
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIGlobals.pm new/kiwi/modules/KIWIGlobals.pm
--- old/kiwi/modules/KIWIGlobals.pm 2014-05-30 14:10:16.000000000 +0200
+++ new/kiwi/modules/KIWIGlobals.pm 2014-06-06 12:08:51.000000000 +0200
@@ -20,6 +20,7 @@
use strict;
use warnings;
use File::Basename;
+use Config::IniFiles;
use LWP;
#==========================================
# KIWI Modules
@@ -504,6 +505,85 @@
}
#==========================================
+# generateBuildInformation
+#------------------------------------------
+sub generateBuildInformation {
+ # ...
+ # write an ini file containing information about
+ # the build. This data is used in the KIWIResult to
+ # create an image release
+ # ---
+ my $this = shift;
+ my $xml = shift;
+ my $cmdL = shift;
+ my $kiwi = $this->{kiwi};
+ #==========================================
+ # requires pointer to xml and command line
+ #------------------------------------------
+ if ((! $xml) || (! $cmdL)) {
+ $kiwi -> warning (
+ "Need pointer to XML config and command line"
+ );
+ $kiwi -> skipped();
+ return;
+ }
+ my $idest = $cmdL -> getImageIntermediateTargetDir();
+ my $name = $this -> generateBuildImageName($xml);
+ my $file = $idest.'/kiwi.buildinfo';
+ KIWIQX::qxx ("echo '[main]' > $file");
+ my $buildinfo = Config::IniFiles -> new (
+ -file => $file, -allowedcommentchars => '#'
+ );
+ if (! $buildinfo) {
+ $kiwi -> warning (
+ "Can't create build info file: $file"
+ );
+ $kiwi -> skipped ();
+ return;
+ }
+ #==========================================
+ # store image base name
+ #------------------------------------------
+ $buildinfo->newval('main', 'image.basename', $name);
+ #==========================================
+ # store build format
+ #------------------------------------------
+ my $bldType = $xml -> getImageType();
+ if ($bldType) {
+ my $format = $bldType -> getFormat();
+ if ($format) {
+ $buildinfo->newval('main', 'image.format', $format);
+ }
+ }
+ #==========================================
+ # store build type
+ #------------------------------------------
+ if ($bldType) {
+ my $imgtype = $bldType -> getTypeName();
+ $buildinfo->newval('main', 'image.type', $imgtype);
+ }
+ #==========================================
+ # store install media type
+ #------------------------------------------
+ if ($bldType) {
+ my $instIso = $bldType -> getInstallIso();
+ my $instStick = $bldType -> getInstallStick();
+ my $instPXE = $bldType -> getInstallPXE();
+ if (($instIso) && ($instIso eq 'true')) {
+ $buildinfo->newval('main', 'install.iso', 'true');
+ }
+ if (($instStick) && ($instStick eq 'true')) {
+ $buildinfo->newval('main', 'install.stick', 'true');
+ }
+ if (($instPXE) && ($instPXE eq 'true')) {
+ $buildinfo->newval('main', 'install.pxe', 'true');
+ }
+ }
+ $buildinfo->RewriteConfig();
+ return $this;
+}
+
+#==========================================
# generateBuildImageName
#------------------------------------------
sub generateBuildImageName {
@@ -1398,7 +1478,7 @@
# Globals (generic)
#------------------------------------------
my %data;
- $data{Version} = "5.06.104";
+ $data{Version} = "5.06.107";
$data{Publisher} = "SUSE LINUX GmbH";
$data{Preparer} = "KIWI - http://opensuse.github.com/kiwi";
$data{ConfigName} = "config.xml";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImageCreator.pm new/kiwi/modules/KIWIImageCreator.pm
--- old/kiwi/modules/KIWIImageCreator.pm 2014-05-23 14:09:43.000000000 +0200
+++ new/kiwi/modules/KIWIImageCreator.pm 2014-06-05 10:40:15.000000000 +0200
@@ -454,7 +454,7 @@
$kiwi -> info ("Reading image description [Upgrade]...\n");
my $buildProfs = $this -> {buildProfiles};
my $xml = KIWIXML -> new(
- $configDir, undef, $buildProfs,$cmdL
+ $configDir, $this->{buildType}, $buildProfs,$cmdL
);
if (! defined $xml) {
return;
@@ -951,6 +951,11 @@
}
}
#==========================================
+ # Create build result information
+ #------------------------------------------
+ KIWIGlobals -> instance()
+ -> generateBuildInformation($xml, $cmdL);
+ #==========================================
# Add system strip from bootincludes
#------------------------------------------
$this -> __addBootincludedToolsToKeep ($xml, $tree);
@@ -2234,7 +2239,6 @@
$kiwi -> warning (
"--> package $pack_name not installed\n"
);
- $kiwi -> skipped();
}
}
my $FILE = FileHandle -> new();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWILinuxRC.sh new/kiwi/modules/KIWILinuxRC.sh
--- old/kiwi/modules/KIWILinuxRC.sh 2014-05-26 15:35:05.000000000 +0200
+++ new/kiwi/modules/KIWILinuxRC.sh 2014-06-06 12:08:51.000000000 +0200
@@ -966,6 +966,11 @@
Echo "Failed to install boot loader"
return 1
fi
+ if [[ $kiwi_iname =~ boot-rhel ]];then
+ # on rhel systems grub.conf is a link to menu.lst.
+ rm -f /etc/grub.conf
+ ln -s /boot/grub/menu.lst /etc/grub.conf
+ fi
else
Echo "Image doesn't have grub installed"
Echo "Can't install boot loader"
@@ -1198,16 +1203,14 @@
# last primary partition of the disk
# ----
local confTool=grub2-mkconfig
- local instTool=grub2-install
- local confPath=/boot/grub2/grub.cfg
+ local confFile_grub_bios=/boot/grub2/grub.cfg
+ local confFile_grub_efi=/boot/grub2-efi/grub.cfg
+ local confFile_uefi=/boot/efi/EFI/BOOT/grub.cfg
+ local confFile_grub=$confFile_grub_bios
+ local bios_grub=/reco-save/boot/grub2/i386-pc
#======================================
# check tool status
#--------------------------------------
- if [ "$partedTableType" = "gpt" ];then
- lookup grub2-efi-mkconfig &>/dev/null && confTool=grub2-efi-mkconfig
- lookup grub2-efi-install &>/dev/null && instTool=grub2-efi-install
- confPath=/boot/grub2-efi/grub.cfg
- fi
if ! lookup $confTool &>/dev/null;then
Echo "Image doesn't have grub2 installed"
Echo "Can't install boot loader"
@@ -1216,29 +1219,49 @@
#======================================
# install grub2 into partition
#--------------------------------------
- $instTool --force \
- --boot-directory=/reco-save/boot $imageRecoveryDevice 1>&2
+ # this allows a bios to directly jump there, e.g with a function key
+ grub2-bios-setup -f -d $bios_grub $imageRecoveryDevice 1>&2
if [ ! $? = 0 ];then
Echo "Failed to install boot loader"
fi
#======================================
# create custom recovery entry
#--------------------------------------
- local method="chainloader +1"
- if [ "$partedTableType" = "gpt" ];then
- method="configfile /boot/grub2/grub.cfg"
- fi
- cat > /etc/grub.d/40_custom <<- EOF
- echo "menuentry 'Recovery' --class os {"
- echo " set root='hd0,$recoid'"
- echo " $method"
- echo "}"
- EOF
- $confTool > $confPath
+ cat > /etc/grub.d/40_custom <<- DONE
+ #!/bin/sh
+ cat <