From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 06/19] ts-host-install: Support UEFI PXE boot using grub.efi Date: Thu, 18 Jun 2015 17:24:57 +0100 Message-ID: <1434644710-28881-6-git-send-email-ian.campbell@citrix.com> References: <1434644687.28264.53.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1434644687.28264.53.camel@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: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- Osstest/TestSupport.pm | 37 ++++++++++++++++++++++++++++++++++++- README | 1 + 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 622f44d..1164a11 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -898,7 +898,7 @@ sub selecthost ($) { $ho->{Tftp} = { }; $ho->{Tftp}{$_} = $c{"Tftp${_}_${tftpscope}"} || $c{"Tftp${_}"} foreach qw(Path TmpDir PxeDir PxeGroup PxeTemplates PxeTemplatesReal - DiBase); + DiBase GrubBase); #----- finalise ----- @@ -2138,6 +2138,41 @@ END sub setup_uboot_pxeboot ($$$$$;%) { return &setup_bios_pxeboot; } sub setup_uboot_pxeboot_local ($) { return &setup_bios_pxeboot_local; } +sub setup_grub_efi_bootcfg ($$) { + my ($ho, $bootfile) = @_; + my $f = "grub.cfg-$ho->{Ether}"; + my $grub= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{GrubBase}.'/'.$c{TftpGrubVersion}. + "/pxegrub-$r{arch}.efi"; + my $pxe=$ho->{Tftp}{Path}.'/'.$ho->{Name}.'/pxe.img'; + + logm("Copy $grub => $pxe"); + copy($grub, $pxe) or die "Copy $grub to $pxe failed: $!"; + + logm("grub_efi bootcfg into $f"); + file_link_contents("$ho->{Tftp}{Path}$ho->{Tftp}{TmpDir}$f", $bootfile, + "$ho->{Name}-pxegrub.cfg"); +} + +# UEFI systems PXE boot using grub.efi +sub setup_uefi_pxeboot ($$$$$;%) { + my ($ho,$kern,$initrd,$dicmd,$hocmd,%xopts) = @_; + setup_grub_efi_bootcfg($ho, < and TftpFoo DiBase The path under `Path' to the root of the debian installer images. + GrubBase The path under `Path' to the root of the grub EFI PXE images. For hosts in scope "default", TftpFoo_default (if set) takes precedence over TftpFoo. TftpFoo is used when the setting Foo is -- 2.1.4