First arrange for bootloader to be installed to removable media path,
by using a new in Jessie preseed option. Then use that to chainload a
bootloader from the disk.

The removable media path is well known (part of the UEFI spec) which
saves us having to worry about which OS is on the host (so long as the
OS can be configured to populate the removable media path)

Signed-off-by: Ian Campbell <ian.campb...@citrix.com>
Acked-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 Osstest/Debian.pm      |  2 ++
 Osstest/TestSupport.pm | 20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index ded8575..9e1e69e 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -757,6 +757,8 @@ d-i apt-setup/contrib boolean false
 
 d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, 
chiark-utils-bin, $extra_packages
 
+d-i grub-installer/force-efi-extra-removable boolean true
+
 $xopts{ExtraPreseed}
 
 END
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 2188cca..699be7e 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2168,7 +2168,25 @@ END
 
 sub setup_pxeboot_local_uefi ($) {
     my ($ho) = @_;
-    die "TODO: setup efi local boot";
+    my %efi_archs = qw(amd64 X64
+                       arm32 ARM
+                       arm64 AARCH64
+                       i386  IA32);
+    die "EFI arch" unless $efi_archs{ $r{arch} };
+    my $efi = $efi_archs{ $r{arch} };
+    setup_grub_efi_bootcfg($ho, <<END);
+set default=0
+set timeout=5
+menuentry 'local' {
+  insmod chain
+  insmod part_gpt
+  insmod part_msdos
+  set root=(hd0,gpt1)
+  echo "Chainloading (\${root})/EFI/BOOT/BOOTAA64.EFI"
+  chainloader (\${root})/EFI/BOOT/BOOTAA64.EFI
+  boot
+}
+END
 }
 
 sub setup_pxeboot_local ($) {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to