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:
parent
2d88f0c0e6
commit
33ba7395b6
49
xCAT-nbroot2/dodiscovery
Executable file
49
xCAT-nbroot2/dodiscovery
Executable 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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user