]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
netboot: Introduce TftpNetGrub*
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 18 Jan 2017 15:26:16 +0000 (15:26 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Sun, 22 Jan 2017 23:44:34 +0000 (23:44 +0000)
* 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@eu.citrix.com>
Osstest.pm
Osstest/TestSupport.pm
README
production-config
production-config-cambridge

index 26fd9d99e77a13ba238d2f63a66f218dad909cf2..4ebd9222fe598d8ace15fc03bd7d7eb51c3c68a2 100644 (file)
@@ -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/";
 
index 0e3772402f614c19d33420e993c63b339beec44c..b1bacb18ef103cc490e1ccf9888557a9ea529839 100644 (file)
@@ -1005,7 +1005,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 -----
 
@@ -2400,7 +2401,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 91d03283248f9ee32c78f82abd54ab7638809776..9dcb65ed1f3813ce56247b31295efe637a65c44b 100644 (file)
--- 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
index 9a299ac2707505d12368431bc2105d51137e53a8..1243d7cecf8ae7186d413948aba1a9adbf915dfe 100644 (file)
@@ -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)
index 9968caa4887f05651d07df7793f0309b1a0681e0..5aefe8f80305ad1934176fb11fcfb8ee20779d74 100644 (file)
@@ -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