pf-tools commit: r633 [ccaillet-guest] - in /trunk: debian/changelog lib/PFTools/Net.pm sbin/mk_pxelinuxcfg

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Tue Aug 12 15:15:42 UTC 2008


Author: ccaillet-guest
Date: Tue Aug 12 15:15:42 2008
New Revision: 633

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=633
Log:
Backport from 0.33-stable branch

Modified:
    trunk/debian/changelog
    trunk/lib/PFTools/Net.pm
    trunk/sbin/mk_pxelinuxcfg

Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/changelog?rev=633&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Tue Aug 12 15:15:42 2008
@@ -1,3 +1,12 @@
+pf-tools (0.33.1-1) unstable; urgency=low
+
+  * Bugfix release
+  * Add : Get_PXE_Filename function for getting pxefilename
+  * Fix : use Get_PXE_Filename instead of Get_Active_Filename in
+    mk_pxelinuxcfg for building pxe files with the correct pxefilename
+
+ -- Christophe Caillet <quadchris at free.fr>  Tue, 12 Aug 2008 17:09:16 +0200
+
 pf-tools (0.33.0-1) unstable; urgency=low
 
   * Release version

Modified: trunk/lib/PFTools/Net.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Net.pm?rev=633&op=diff
==============================================================================
--- trunk/lib/PFTools/Net.pm (original)
+++ trunk/lib/PFTools/Net.pm Tue Aug 12 15:15:42 2008
@@ -35,6 +35,7 @@
 
     Get_Active_Filename
     Get_Active_Systemmap
+    Get_PXE_Filename
     Get_Ordered_Filtered_Hosts
     Get_dns_from_hostname
     Get_dns_from_zone
@@ -653,7 +654,7 @@
     return ( $M->{'cmdline'} );
 }
 
-sub Get_Active_Filename {
+sub Get_PXE_Filename {
     my ( $Z, $host ) = @_;
 
     my $host2 = $host;
@@ -674,6 +675,36 @@
 	return undef;
     }
 
+    if ( $M->{'arch'} eq 'amd64' ) {
+	return ( $M->{'arch'}."/".$M->{'pxefilename'} );
+    }
+    else {
+	return ( $M->{'pxefilename'} );
+    }
+}
+
+
+sub Get_Active_Filename {
+    my ( $Z, $host ) = @_;
+
+    my $host2 = $host;
+    $host2 =~ s/^(.+)\.$Z->{SOA}->{name}$/$1/;
+    $host2 =~ m/^([^.]+)(\.([^.]+))?$/;
+    my $hostshort = $1;
+    my $hostvlan  = $3;
+
+    if ( !defined $hostshort ) {
+	return undef;
+    }
+
+    my $hostclass = Host_class( $hostshort, $Z );
+    my $N         = $Z->{'SERVERS'}->{'BY_NAME'}->{$hostclass};
+    my $M         = $N->{'SRVLIST'}->{$hostshort};
+
+    if ( !defined($M) ) {
+	return undef;
+    }
+
     return ( $M->{'umlfilename'} ) if ($PFTOOLS_VARS->{'UML'} && defined $M->{'umlfilename'});
     return ( $M->{'vmwfilename'} ) if ($PFTOOLS_VARS->{'VMWARE'} && defined $M->{'vmwfilename'});
     if ( $M->{'arch'} eq 'amd64' ) {
@@ -687,7 +718,7 @@
 sub Get_Active_Systemmap {
     my ( $Z, $host ) = @_;
 
-    my $system_map = Get_Active_Filename ( $Z, $host ) ;
+    my $system_map = Get_PXE_Filename ( $Z, $host ) ;
     $system_map =~ s/vmlinuz/System.map/ ;
     return $system_map ;
 }

Modified: trunk/sbin/mk_pxelinuxcfg
URL: http://svn.debian.org/wsvn/pf-tools/trunk/sbin/mk_pxelinuxcfg?rev=633&op=diff
==============================================================================
--- trunk/sbin/mk_pxelinuxcfg (original)
+++ trunk/sbin/mk_pxelinuxcfg Tue Aug 12 15:15:42 2008
@@ -181,7 +181,7 @@
 								}
 	
 								my $temptemplatecontent = join '', @{ $templates->{$template_name} };
-								my $kernel_filename	= Get_Active_Filename ( $Z, $m ) ;
+								my $kernel_filename	= Get_PXE_Filename ( $Z, $m ) ;
 								if ( ! defined $kernel_filename ) {
 									warn "Unable to retrieve kernel filename for host ".$m."\n" ;
 								}




More information about the pf-tools-commits mailing list