From: Ian Jackson Subject: [OSSTEST PATCH 19/26] ts-debian-hvm-install: Cope with images containing only isolinux Date: Fri, 18 Sep 2015 18:50:09 +0100 Message-ID: <1442598616-2884-6-git-send-email-ian.jackson@eu.citrix.com> References: <1442598616-2884-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zcznu-0004Hv-9f for xen-devel@lists.xenproject.org; Fri, 18 Sep 2015 17:50:34 +0000 In-Reply-To: <1442598616-2884-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org debian-7.2.0-i386-CD-1.iso contains no grub, only isolinux. If the specified EFI grub file does not exist, fall back to isolinux. This requires a -c option as well, according to https://wiki.debian.org/DebianInstaller/Modify/CD Only try to set up a grub config if we are booting grub. (The i386 image in question does not contain a [debian]/boot/grub directory.) If boot/grub/efi.img _does_ exist (ie, for other existing tests), the only difference in behaviour is to reorder slightly the options to genisoimage: `-b boot/grub/efi.img' now occurs after `-no-emul-boot -r' rather than before. Signed-off-by: Ian Jackson --- ts-debian-hvm-install | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install index 3b93ebd..71ab1a5 100755 --- a/ts-debian-hvm-install +++ b/ts-debian-hvm-install @@ -197,9 +197,16 @@ sub prep () { my $preseed_file_path = $base . "preseed"; my @isogen_extra = qw(-eltorito-alt-boot - -b boot/grub/efi.img -no-emul-boot -r); + + my $bootfile = 'boot/grub/efi.img'; + if (!target_file_exists($ho, "$newiso/$bootfile")) { + $bootfile = "isolinux/isolinux.bin"; + push @isogen_extra, qw(-c isolinux/boot.cat); + } + push @isogen_extra, '-b', $bootfile; + my @isogen_opts = (iso_gen_flags_basic(), @isogen_extra); iso_create_empty($ho, $emptyiso, $emptydir); @@ -226,8 +233,10 @@ sub prep () { my $cmds = iso_copy_content_from_image($gho, $newiso); $cmds .= prepare_initrd($initrddir,$newiso,$preseed_file_path); target_cmd_root($ho, $cmds, $isotimeout); + target_putfilecontents_root_stash($ho, 10, grub_cfg(), - "$newiso/debian/boot/grub/grub.cfg"); + "$newiso/debian/boot/grub/grub.cfg") + if $bootfile =~ m/grub/; target_putfilecontents_root_stash($ho, 10, isolinux_cfg(), "$newiso/isolinux/isolinux.cfg"); -- 1.7.10.4