[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-28-gbac4d64

Andreas B. Mundt andi.mundt at web.de
Tue Aug 21 11:25:41 UTC 2012


The following commit has been merged in the master branch:
commit 05d21c3297245ee38ed2b49b73f0da40c46ea828
Author: Andreas B. Mundt <andi.mundt at web.de>
Date:   Tue Aug 21 10:50:01 2012 +0200

    Improve machine handling.  PXE boot unknown machines to sysinfo.
    
    Machines not yet added with fixed IP address to DHCP are PXE booted with
    FAI_ACTION=sysinfo.  The script debian-lan uses the kernel's ARP cache
    now to look for candidates to be added to DHCP.
    
    HOWTO (mass) add machines:
        - switch on all machines you want to add and PXE boot
        - make sure no 'foreign' machines are in the network or note their
          hardware (MAC) address
        - eventually wait a bit, until all unwanted entries have vanished
          from the ARP cache
        - run 'debian-lan add2dhcp' and choose the machine's type

diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER
index a44331d..f5bd06e 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/etc/rc.local/FAISERVER
@@ -49,6 +49,9 @@ if wget --quiet --output-document=/tmp/fai-setup $URL ; then
 	NUM=$(($NUM+1))
     done
 
+    ## create default configuration (sysinfo) if not yet in place:
+    fai-chboot -p -S default
+
     ## Use git to track modifications of the config space:
     cd $FAI_CONFIGDIR
     git init
diff --git a/fai/config/files/usr/sbin/debian-lan/SERVER_A b/fai/config/files/usr/sbin/debian-lan/SERVER_A
index 1768495..efee0e2 100755
--- a/fai/config/files/usr/sbin/debian-lan/SERVER_A
+++ b/fai/config/files/usr/sbin/debian-lan/SERVER_A
@@ -183,8 +183,12 @@ EOF
 	echo
 	;;
     add2dhcp)
-	locHW=`ifconfig -a | grep -o "\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}"`
-	allHW=`grep -o "\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}" /var/log/syslog | sort -u`
+	## GW: gateway hardware address
+	GW=`ip route show | grep default | egrep -o '[1-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'`
+	## locHW: all local hardware addresses
+	locHW=`ip addr show | grep -o "\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}" | sort -u | sed '1d;$d'`
+	## allHW: all known hardware addresses with gateway address removed
+	allHW=`ip neigh show | sed "/$GW/d" | grep -o "\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}" | sort -u`
 	for HWaddr in $allHW ; do
 	    if echo $locHW | grep -q $HWaddr ; then
 		echo "Skipping local MAC address: ${HWaddr}"
diff --git a/fai/config/scripts/FAISERVER/30-exports b/fai/config/scripts/FAISERVER/30-exports
index fc3f06e..49bd989 100755
--- a/fai/config/scripts/FAISERVER/30-exports
+++ b/fai/config/scripts/FAISERVER/30-exports
@@ -2,5 +2,5 @@
 
 set -e
 
-ainsl /etc/exports "/srv/fai/nfsroot  ${FAINETMASK}(async,ro,no_subtree_check,no_root_squash)"
+ainsl /etc/exports "/srv/fai/nfsroot  ${SUBNETMASK}(async,ro,no_subtree_check,no_root_squash)"
 ainsl /etc/exports "/srv/fai/config   ${FAINETMASK}(async,ro,no_subtree_check,no_root_squash)"

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list