pf-tools/pf-tools: * adding pxetemplate as in pf-tools 0.X in se...

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Thu Mar 3 14:01:21 UTC 2011


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/ab601c4cd57f
changeset: 1171:ab601c4cd57f
user:      "Christophe Caillet <quadchris at free.fr>"
date:      Thu Mar 03 15:01:03 2011 +0100
description:
* adding pxetemplate as in pf-tools 0.X in section boot on hostfile
* adding the specified template in parameter for make_pxe_boot_preseed_files

diffstat:

1 file changed, 2 insertions(+)
debian/changelog |    2 ++

diffs (94 lines):

diff -r c8d956f0d489 -r ab601c4cd57f debian/changelog
--- a/debian/changelog	Fri Jan 07 18:54:58 2011 +0100
+++ b/debian/changelog	Thu Mar 03 15:01:03 2011 +0100
@@ -35,8 +35,10 @@
   * adding a preseed key in deployment section for host declaration, which
     permits the specification of particular preseed template for a given host
     which overrides the preseed key in pf-tools.conf file
+  * adding pxetemplate as in pf-tools 0.X in section boot on hostfile
+  * adding the specified template in parameter for make_pxe_boot_preseed_files 
 
- -- Christophe Caillet <quadchris at free.fr>  Fri, 05 Nov 2010 13:43:41 +0100
+ -- Christophe Caillet <quadchris at free.fr>  Thu, 03 Mar 2011 14:57:31 +0100
 
 pf-tools (1.0-1) unstable; urgency=low
 
diff -r c8d956f0d489 -r ab601c4cd57f doc/hostfile-syntax
--- a/doc/hostfile-syntax	Fri Jan 07 18:54:58 2011 +0100
+++ b/doc/hostfile-syntax	Thu Mar 03 15:01:03 2011 +0100
@@ -55,6 +55,7 @@
 
 [boot]
 	? pxefilename[.%HOSTNUM%]	::= <FILENAME> pxelinux.0 is used by default (generic legacy PXE boot) need to change if UEFI is used
+	? pxetemplate[.%HOSTNUM%]	::= <FILENAME> template for providing PXE boot file for tftp server
 	! kernel[.%HOSTNUM%]		::= <KERNEL_FILENAME> this filename is searched into the kernel tftp directory define in pf-tools.conf
 	? initrd[.%HOSTNUM%]		::= <INITRD_FILENAME> this filename is searched into the kernel tftp directory define in pf-tools.conf
 	? kerneluml[.%HOSTNUM%]		::= <KERNEL_FILENAME> this filename is searched into the kernel tftp directory define in pf-tools.conf for UML hosts
diff -r c8d956f0d489 -r ab601c4cd57f lib/PFTools/Conf/Syntax.pm
--- a/lib/PFTools/Conf/Syntax.pm	Fri Jan 07 18:54:58 2011 +0100
+++ b/lib/PFTools/Conf/Syntax.pm	Thu Mar 03 15:01:03 2011 +0100
@@ -168,6 +168,7 @@
         'boot' => {
             'MANDATORY_KEYS' => ['kernel'],
             'pxefilename'    => 'undefined',
+            'pxetemplate'    => 'undefined',
             'kernel'         => 'undefined',
             'initrd'         => 'undefined',
             'kerneluml'      => 'undefined',
diff -r c8d956f0d489 -r ab601c4cd57f sbin/mk_pxelinuxcfg
--- a/sbin/mk_pxelinuxcfg	Fri Jan 07 18:54:58 2011 +0100
+++ b/sbin/mk_pxelinuxcfg	Thu Mar 03 15:01:03 2011 +0100
@@ -118,7 +118,7 @@
 
 =cut
 
-my $site_part = get_site_config( $options->{'site'}, $global_config );
+my $site_part = get_site_config( $options->{'site'}, $GLOBAL_STRUCT );
 my $host_part = $site_part->{'HOST'}->{'BY_NAME'};
 foreach my $hostclass ( @{ $site_part->{'HOST'}->{'__hostclass_pxe'} } ) {
     foreach my $host ( keys %{ $host_part->{$hostclass} } ) {
@@ -131,6 +131,16 @@
             pf_config     => $PF_CONFIG,
             pf_script     => $options->{'script'},
         };
+        if ( $host->{'boot'}->{'pxetemplate'} ) {
+            $args_ref->{'pxe_template_file'} =
+                ( $host->{'boot'}->{'pxetemplate'} =~ m{^/} )
+                ? $host->{'boot'}->{'pxetemplate'}
+                : join (
+                    '/',
+                    $PF_CONFIG->{'path'}->{'templates_dir'},
+                    $host->{'boot'}->{'pxetemplate'}
+                );
+        }
         make_pxe_boot_and_preseed_files($args_ref);
     }
 }
diff -r c8d956f0d489 -r ab601c4cd57f t/13.conf.t
--- a/t/13.conf.t	Fri Jan 07 18:54:58 2011 +0100
+++ b/t/13.conf.t	Thu Mar 03 15:01:03 2011 +0100
@@ -1694,7 +1694,7 @@
 
 # http://rt.perl.org/rt3/Public/Bug/Display.html?id=52610
 SKIP: {
-    skip q{Perl bug #52610}, 2; # only if Test::Exception < 0.31 ?
+    skip q{Perl bug #52610}, 6; # only if Test::Exception < 0.31 ?
 
 throws_ok { get_site_dhcp_config() }
 qr{ \A ERROR: [ ] Invalid [ ] site_name }xms
@@ -1703,7 +1703,6 @@
 throws_ok { get_site_dhcp_config( q{} ) }
 qr{ \A ERROR: [ ] Invalid [ ] site_name }xms
     => q{Dies if empty site_name};
-}
 
 throws_ok { get_site_dhcp_config( {} ) }
 qr{ \A ERROR: [ ] Invalid [ ] site_name }xms
@@ -1720,6 +1719,7 @@
 throws_ok { get_site_dhcp_config( q{site_name}, $global_config ) }
 qr{ \A ERROR: [ ] Unknown [ ] site [ ] }xms
     => q{Dies if unknown site_name};
+}
 
 $result = get_site_dhcp_config( q{cbv4}, $global_config );
 



More information about the pf-tools-commits mailing list