[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 23/35] netboot: Introduce TftpNetGrub*



* When expanding netboot filenames, look for NetGrub config keys
  rather than Pxe filenames.  Currently this only affects mg-hosts
  because the files are created by setup_grub_efi_bootcfg, and the
  files are of course referred to only by the actual netboot grub
  image (which may be made by mg-netgrub-loader-update: neither of
  which honour these variables.

* Update the documentation, the default configs, and the
  production-config-*.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest.pm                  |  2 ++
 Osstest/TestSupport.pm      |  6 ++++--
 README                      | 23 +++++++++++++++++------
 production-config           |  3 +++
 production-config-cambridge |  3 +++
 5 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/Osstest.pm b/Osstest.pm
index 26fd9d9..4ebd922 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -221,6 +221,8 @@ sub readglobalconfig () {
     $c{TftpPath} ||= "/tftpboot/";
     $c{TftpPxeDir} ||= "pxelinux.cfg/";
     $c{TftpPxeTemplates} ||= '%ipaddrhex% 01-%etherhyph%';
+    $c{TftpNetGrubDir} ||= "Netgub.cfg/";
+    $c{TftpNetGrubTemplates} ||= '%ether%';
     $c{TftpPlayDir} ||= "$c{Username}/osstest/";
     $c{TftpTmpDir} ||= "$c{TftpPlayDir}tmp/";
 
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 990ddbc..6d0f967 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -994,7 +994,8 @@ sub selecthost ($) {
     $ho->{Tftp} = { };
     $ho->{Tftp}{$_} = $c{"Tftp${_}_${tftpscope}"} || $c{"Tftp${_}"}
         foreach qw(Path TmpDir PxeDir PxeGroup PxeTemplates PxeTemplatesReal
-                   DiBase GrubBase);
+                   DiBase GrubBase
+                   NetGrubDir NetGrubTemplates NetGrubTemplatesReal);
 
     #----- finalise -----
 
@@ -2389,7 +2390,8 @@ sub host_netboot_file ($;$) {
     # in array context, returns (dir, pathtail)
     #  where dir does not depend on $templatekeytail
     my %v = %r;
-    my $templatekeybase = 'Pxe';
+    my $firmware = get_host_property($ho, "firmware", "bios");
+    my $templatekeybase = $firmware eq 'uefi' ? 'NetGrub' : 'Pxe';
     $templatekeytail //= 'Templates';
     my $templatekey = $templatekeybase.$templatekeytail;
     my $templates = $ho->{Tftp}{$templatekey};
diff --git a/README b/README
index 91d0328..9dcb65e 100644
--- a/README
+++ b/README
@@ -501,14 +501,21 @@ Tftp*
 
     TftpPxeDir        The path under `Path' to the PXE configuration directory
                       (e.g. pxelinux.cfg/).   Include the trailing /.
-    TftpPxeGroup      The Unix group which should own files under `PxeDir'.
-    TftpPxeTemplates  See TftpPxeTemplates
-    TftpPxeTemplatesReal
+    TftpNetGrubDir    The path under `Path' to the grub EFI netboot directory
+                      Include the trailing /.
+
+    TftpPxeGroup      The Unix group which should own files under `PxeDir'
+                      and NetGrubDir.
+
+    TftpPxeTemplates          } See below
+    TftpPxeTemplatesReal      }
+    TftpNetGrubTemplates      }
+    TftpNetGrubTemplatesReal  }
 
     TftpDiBase        The path under `Path' to the root of the debian
                       installer images.
     TftpGrubBase      The path under `Path' to the root of the grub
-                      EFI netboot images.
+                      EFI netboot (`netgrub') images.
 
 Tftp<setting>_<scope>
 
@@ -524,6 +531,7 @@ Tftp<setting>_<scope>
     Tftp<setting>_default is not defined.
 
 TftpPxeTemplates
+TftpNetGrubTemplates
     List (space-separated) of template filenames for writing
     The templates contain variable substitutions %var%
     The variables are the runvars plus
@@ -535,11 +543,14 @@ TftpPxeTemplates
     Templates containing references to unknown %var%s - particularly,
     the host mac address when not known, or the guest's dynamic
     ip address - are skipped.  The first template all of whose ingredients
-    are known is used, with TftpPath and TftpPxeDir prepended.
+    are known is used, with TftpPath and TftpPxeDir or TftpNetGrubDir
+    prepended.
 
 TftpPxeTemplatesReal
+TftpNetGrubTemplatesReal
     Template filename which mg-hosts mknetbootdir should make be a
-    symlink to the TftpPxeTemplates.  Not used otherwise.
+    symlink to the TftpPxeTemplates or TftpNetGrubTemplates.  Not used
+    otherwise.
 
 Timezone
     Olson TZ name, used by host and guest installers
diff --git a/production-config b/production-config
index 9a299ac..1243d7c 100644
--- a/production-config
+++ b/production-config
@@ -84,6 +84,9 @@ TftpTmpDir osstest/tmp/
 TftpPxeDir /
 TftpPxeTemplates %name%/pxelinux.cfg
 TftpPxeTemplatesReal pxelinux.cfg/%ipaddrhex%
+TftpNetGrubDir /
+TftpNetGrubTemplates %name%/netgrub.cfg
+TftpNetGrubTemplatesReal Netgrub.cfg/%ether%
 
 TftpPxeGroup osstest
 # Update with ./mg-debian-installer-update(-all)
diff --git a/production-config-cambridge b/production-config-cambridge
index 9968caa..5aefe8f 100644
--- a/production-config-cambridge
+++ b/production-config-cambridge
@@ -67,6 +67,9 @@ TftpTmpDir osstest/tmp/
 TftpPxeDir /
 TftpPxeTemplates %name%/pxelinux.cfg
 TftpPxeTemplatesReal pxelinux.cfg/%ipaddrhex%
+TftpNetGrubDir /
+TftpNetGrubTemplates %name%/netgrub.cfg
+TftpNetGrubTemplatesReal Netgrub.cfg/%ether%
 
 TftpPxeGroup osstest
 TftpDiVersion_wheezy 2016-06-08
-- 
2.1.4


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.