From 9578b359746aa53f8b5a76f548463f00fdee804e Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 21 Nov 2009 17:01:06 +0000 Subject: [PATCH] -Refactor network detection to tolerate arbitrary number of interfaces appearing as part of driver load -Load the mellanox ethernet layer if loading mellanox core for now git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4637 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot/overlay/etc/init.d/S10autodetect | 35 +++++++------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/xCAT-nbroot/overlay/etc/init.d/S10autodetect b/xCAT-nbroot/overlay/etc/init.d/S10autodetect index a389d4844..1e5041466 100755 --- a/xCAT-nbroot/overlay/etc/init.d/S10autodetect +++ b/xCAT-nbroot/overlay/etc/init.d/S10autodetect @@ -53,11 +53,10 @@ do echo "alias myri0 $MOD" >>/etc/modules.conf echo "alias myri0 $MOD" >>/etc/modprobe.conf else - modprobe $MOD - ifconfig eth$nic up - udhcpc -i eth$nic -b & - NICSTOWAIT="$NICSTOWAIT eth$nic" - nic=$(($nic + 1)) + modprobe $MOD + if [ "mlx4_core" = "$MOD" ]; then + modprobe mlx4_en + fi fi ;; scsi|raid) @@ -80,15 +79,6 @@ for dir in /proc/device-tree/vdevice/l-lan*; do done if [ $NEEDVETH == 1 ]; then modprobe ibmveth - for i in /sys/bus/vio/drivers/ibmveth/*/net*; do - udhcpc -i eth$nic -b - let extrat=0 - until ifconfig eth$nic|grep "inet addr" || [ $extrat == 30 ]; do - sleep 1 - let extrat=extrat+1 - done - nic=$(($nic + 1)) - done fi NEEDEHEA=0; for dir in /proc/device-tree/lhea*; do @@ -96,17 +86,16 @@ for dir in /proc/device-tree/lhea*; do done if [ $NEEDEHEA == 1 ]; then modprobe ehea - for i in /sys/bus/ibmebus/devices/port*; do - udhcpc -i eth$nic -b - let extrat=0 - until ifconfig eth$nic|grep "inet addr" || [ $extrat == 30 ]; do - sleep 1 - let extrat=extrat+1 - done - nic=$(($nic + 1)) - done fi +NICSTOWAIT=`/sbin/ifconfig -a|grep HWaddr|grep ^eth|sed -e 's/ .*//'` +for nic in $NICSTOWAIT; do + ifconfig $nic up + udhcpc -i $nic -b & +done + + + let extrat=0 until [ $extrat == 80 -o -z "$NICSTOWAIT" ]; do sleep 1