[Fai-commit] r5795 - branches/experimental/patches

Michael Tautschnig mt at alioth.debian.org
Tue Jun 1 06:30:51 UTC 2010


Author: mt
Date: 2010-06-01 06:30:39 +0000 (Tue, 01 Jun 2010)
New Revision: 5795

Added:
   branches/experimental/patches/fai-chboot_mac-address
Modified:
   branches/experimental/patches/series
Log:
added fai-chboot patch (mac address support)


Added: branches/experimental/patches/fai-chboot_mac-address
===================================================================
--- branches/experimental/patches/fai-chboot_mac-address	                        (rev 0)
+++ branches/experimental/patches/fai-chboot_mac-address	2010-06-01 06:30:39 UTC (rev 5795)
@@ -0,0 +1,61 @@
+2010-05-31  Michael Tautschnig  <mt at debian.org>
+
+	* fai-chboot, fai-chboot.8: Also accept mac addresses as host specifications
+		(thanks Torge Gipp <post at torge-gipp.de>)
+Index: trunk/bin/fai-chboot
+===================================================================
+--- trunk.orig/bin/fai-chboot
++++ trunk/bin/fai-chboot	
+@@ -56,6 +56,13 @@
+     return ip2hex($host);
+   }
+   return ('no IP','default') if ($host =~ /^default/);
++  # mac address using : or - as separators
++  if ($host =~ /^([[:xdigit:]]{2}[:-]){5}[[:xdigit:]]{2}$/) { # Pattern-Matching
++	  $host = lc $host; # Lowercase for pxe-file
++	  my @nums = split /[:-]/, $host;
++	  $mac = "01-$nums[0]-$nums[1]-$nums[2]-$nums[3]-$nums[4]-$nums[5]"; #
++	  return ($host,$mac);
++  }
+ 
+   my $h = gethost($host);
+   die "$0: unknown host: $host\n" unless $h;
+@@ -259,7 +266,7 @@
+   }
+   open (FILE,"> $pxedir/$hex") or warn "$0 $@ $!";
+   print FILE << "EOM";
+-# generated by fai-chboot for host $host with IP $ipadr
++# generated by fai-chboot for host $host with address $ipadr
+ default fai-generated
+ 
+ label fai-generated
+@@ -307,7 +314,7 @@
+   my ($srcfile, $pxedir, $desthex, $desthost, $ipadr) = @_;
+   open (SOURCE, "$srcfile");
+   open (DEST, ">$pxedir/$desthex") || die "Can't opendir $pxedir: $!";
+-  print DEST "# template generated by fai-chboot for host $desthost with IP $ipadr from source $srcfile\n";
++  print DEST "# template generated by fai-chboot for host $desthost with address $ipadr from source $srcfile\n";
+   while (<SOURCE>) {
+     print DEST $_;
+   }
+Index: trunk/man/fai-chboot.8
+===================================================================
+--- trunk.orig/man/fai-chboot.8
++++ trunk/man/fai-chboot.8	
+@@ -1,5 +1,5 @@
+ .\"                                      Hey, EMACS: -*- nroff -*-
+-.TH fai-chboot 8 "21 October 2009" "FAI 3.3"
++.TH fai-chboot 8 "31 May 2010" "FAI 3.4"
+ .\"
+ .\" File Name macro.  This used to be `.PN', for Path Name,
+ .\" but Sun doesn't seem to like that very much.
+@@ -40,7 +40,8 @@
+ additional kernel parameters and define some FAI specific flags. For
+ each host one configuration file is created. The file name of the
+ configuration file is its IP address in upper case hexadecimal. HOST
+-can be a host name, an IP address or the keyword "default".
++can be a host name, an IP address, a MAC address (hexadecimal words
++separated by ":" or "\-"), or the keyword "default".
+ 
+ .SH OPTIONS
+ .TP

Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2010-05-31 15:13:28 UTC (rev 5794)
+++ branches/experimental/patches/series	2010-06-01 06:30:39 UTC (rev 5795)
@@ -19,3 +19,4 @@
 setup-storage_tmpfs
 setup-storage_external-journal
 setup-storage_cciss-bugfix
+fai-chboot_mac-address




More information about the Fai-commit mailing list