From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 27/35] netboot: UEFI grub: Do it more like pxe
Date: Fri, 20 Jan 2017 12:19:16 +0000 [thread overview]
Message-ID: <1484914764-20861-28-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1484914764-20861-1-git-send-email-ian.jackson@eu.citrix.com>
* Abolish setup_grub_efi_bootcfg and use setup_netboot_bootcfg
instead. The latter function now expects to be given a config file
for the host's bootloader. For a UEFI host, that's a grub config
file, which it will write to the configured NetGrub location for the
specific host.
* Consequently, we no longer copy an actual grub image around every
time we do a bootloader setup. Instead, we expect that the tftp
server will be configured to point relevant hosts at a suitable
fixed image, which will go to our config file.
* Also, consequently, write the NetGrubTemplate path when we want to
setup the bootloader, rather than the ad-hoc grub-%ether%.
* Update mg-netgrub-loader-update jessie so that it writes the
NetGrubTemplateReal from the config into the grub.cfg so that the
grub image will read that file and then read the file created by
setup_netboot_bootcfg.
* Document this in its head comment.
Currently this new mg-netgrub-loader-update is untested because jessie
i386 grub (which is what we would run on the osstest controllers) does
not understand the arm64-efi target. But the new Netgrub.cfg location
is in use.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
Osstest/TestSupport.pm | 19 ++-----------------
mg-netgrub-loader-update | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 9be40a2..ed70579 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2457,25 +2457,10 @@ END
sub setup_netboot_di_uboot ($$$$$;%) { return &setup_netboot_di_bios; }
sub setup_netboot_local_uboot ($) { return &setup_netboot_local_bios; }
-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 $img=$ho->{Tftp}{Path}.'/'.hostnamepath($ho).'/pxe.img';
-
- logm("Copy $grub => $img");
- copy($grub, $img) or die "Copy $grub to $img failed: $!";
-
- logm("grub_efi bootcfg into $f");
- file_link_contents("$ho->{Tftp}{Path}$ho->{Tftp}{TmpDir}$f",
- $bootfile, hostnamepath($ho)."-pxegrub.cfg");
-}
-
# UEFI systems netboot using grub.efi
sub setup_netboot_di_uefi ($$$$$;%) {
my ($ho,$kern,$initrd,$dicmd,$hocmd,%xopts) = @_;
- setup_grub_efi_bootcfg($ho, <<END);
+ setup_netboot_bootcfg($ho, <<END);
set default=0
set timeout=5
menuentry 'overwrite' {
@@ -2493,7 +2478,7 @@ sub setup_netboot_local_uefi ($) {
i386 IA32);
die "EFI arch" unless $efi_archs{ $r{arch} };
my $efi = $efi_archs{ $r{arch} };
- setup_grub_efi_bootcfg($ho, <<END);
+ setup_netboot_bootcfg($ho, <<END);
set default=0
set timeout=5
menuentry 'local' {
diff --git a/mg-netgrub-loader-update b/mg-netgrub-loader-update
index ec6dfd3..21157a2 100755
--- a/mg-netgrub-loader-update
+++ b/mg-netgrub-loader-update
@@ -3,6 +3,12 @@
# ./mg-netgrub-loader-update jessie
#
# Requires grub-mkimage (Debian package: grub-common)
+#
+# Creates $c{TftpPath}/$c{TftpGrubBase}/YYYY-MM-DD/grub/*.efi
+# which expect to load .../YYYY-MM-DD/grub/grub.cfg
+# which in turn loads .../Netgrub.cfg/EE:EE:EE:EE:EE:EE\b
+# (where EE:EE:EE:EE:EE:EE is the MAC address)
+# (or whatever else is specified in TftpNetGrubTemplates).
# This is part of "osstest", an automated testing framework for Xen.
# Copyright (C) 2015 Citrix Inc.
@@ -40,6 +46,17 @@ dst=$date
grubpfx=$grubbase/$date/grub
+grubcfg=$(perl -e '
+ use Osstest;
+ use Osstest::TestSupport;
+ readglobalconfig;
+ my $k = qw(TftpNetGrubTemplatesReal);
+ my $file = subst_netboot_template $c{$k},
+ { ether => qw(${net_default_mac}) },
+ $k;
+ print $file, "\n" or die $!;
+')
+
mkdir -p $dstroot
cd $dstroot
mkdir -p $dst
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-20 12:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 12:18 [OSSTEST PATCH 00/35] ARM64 softiron support Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 01/35] Serial console: honour LinuxSerialConsole in bootloader setup Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 02/35] ts-host-install: Expect "pool" in ntp.conf, not only "server" Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 03/35] ts-host-install: NTP not honoured bug remains Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 04/35] mg-debian-installer-update: Break out default setting of src= Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 05/35] mg-debian-installer-update: Print working directory to stderr Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 06/35] mg-debian-installer-update: Log our version into our output Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 07/35] mg-debian-installer-update: backports: Provide pps and ptp Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 08/35] mg-debian-installer-update: backports: Add modules for EFI Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 09/35] mg-debian-installer-update: backports: Provide crypto Ian Jackson
2017-01-20 12:18 ` [OSSTEST PATCH 10/35] backports handling: Refactor kernel deb handling Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 11/35] backports handling: Make backports initramfs-tools optional Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 12/35] backports handling: Cope with dtbs in subdirs Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 13/35] d-i: Cope if .ssh already exists (in /target/root/ and also /home/...) Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 14/35] d-i grub: Extend UEFI workaround to stretch Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 15/35] pxe templates: Do defaulting outside host_pxefile Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 16/35] netboot: Rework interface to host_netboot_file (was host_pxefile) Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 17/35] netboot: Rename pxeboot functions Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 18/35] netboot: Change pxe to netboot in comments, docs and messages Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 19/35] netboot: Change pxe to netboot in variable names Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 20/35] netboot: Rename mg-netgrub-loader-update Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 21/35] netboot: Rename ./mg-hosts mknetbootdir subcommand Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 22/35] netboot: Break out subst_netboot_template Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 23/35] netboot: Introduce TftpNetGrub* Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 24/35] netboot: Change stash file name to not be pxelinux-specific Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 25/35] mg-netgrub-loader-update: Introduce $grubbase Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 26/35] mg-netgrub-loader-update: Introduce $img Ian Jackson
2017-01-20 12:19 ` Ian Jackson [this message]
2017-01-20 12:19 ` [OSSTEST PATCH 28/35] netboot: mg-netgrub-loader-update: Print sample dhcp config fragment Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 29/35] netboot: Rename TftpNetbootGroup (from TftpPxeGroup) Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 30/35] netboot: mg-netgrub-loader-update: Add some more docs Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 31/35] d-i: preseed_create_guest: Break out preseed_backports_packages Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 32/35] d-i: backports: When using backports kernel for a host, install linux-base Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 33/35] d-i: When using backports kernel, suppress kernel modules warning Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 34/35] d-i: Add comment about interrupting the install Ian Jackson
2017-01-20 12:19 ` [OSSTEST PATCH 35/35] ARM64: Create jobs, and provide the installer (with backports kernel) Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484914764-20861-28-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).