Further progress on nbroot2

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9846 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2011-06-17 21:00:46 +00:00
parent 2d88f0c0e6
commit 33ba7395b6
2 changed files with 54 additions and 2 deletions

49
xCAT-nbroot2/dodiscovery Executable file
View File

@ -0,0 +1,49 @@
#!/bin/sh
minixcatd.awk &
echo "Beginning node discovery process"
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v usb|grep -v ,UP|awk -F: '{print $2}'`
for nic in $NICSTOBRINGUP; do
dhclient $nic &
#no need to go out of our way for superfluous ipv6 nics
done
waitforlink=100
while [ ! -z "$NICSTOBRINGUP" -a $waitforlink -gt 0 ]; do
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v usb|grep -v ,LOWER_UP|awk -F: '{print $2}'`
waitforlink = $((waitforlink - 1))
sleep 0.1
if [ $waitforlink = 1 ]; then
echo "No link detected on $NICSTOBRINGUP"
fi
done
NICSGETTINGADDR=`ip link|grep mtu|grep -v LOOPBACK|grep -v usb|grep ,LOWER_UP|awk -F: '{print $2}'`
timewaiting=0
echo "Waiting for nics to get addresses"
while [ ! -z "$NICSGETTINGADDR" -a $timewaiting != 700 ]; do
NEWNICSGETTINGADDR=""
for nic in $NICSGETTINGADDR; do
if ! ip addr show dev $nic |grep -v inet6|grep inet >/dev/null; then
NEWNICSGETTINGADDR="$NEWNICSGETTINGADDR $nic"
else
echo -n "$nic|"
ip addr show dev $nic |grep -v inet6|grep inet|sed -e s/\\/.*//|awk '{print $2}'
fi
done
sleep 0.1
timewaiting=$((timewaiting+1))
if [ $timewaiting = 450 ]; then
echo "45 seconds without an address on $nic, is spanning tree set to slow?"
fi
if [ $timewaiting = 699 ]; then
echo "No DHCP answer for $nic, ignoring interface"
fi
NICSGETTINGADDR=$NEWNICSGETTINGADDR
done
echo "Stopped waiting on nics to get addresses"
while [ ! -r /restart ]; do
sleep 1
done

View File

@ -6,6 +6,8 @@ echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh
udevd --daemon
udevadm trigger
mkdir -p /var/lib/dhclient/
ip link set lo up
ip addr add dev lo 127.0.0.1/8
if [ ! -z "$BOOTIF" ]; then
BOOTIF=`echo $BOOTIF|sed -e s/01-// -e s/-/:/g`
echo -n "Waiting for device with address $BOOTIF to appear.."
@ -58,6 +60,7 @@ while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v
done
echo -n "Acquired IPv4 address "
ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}'
if [ "$destiny" = "discover" ]; then #skip a query to xCAT when /proc/cmdline will do
/bin/dodiscovery
fi
/bin/dash