For AIX, remove the original ib configuration; use the loop number instead of 0, 1, 2...

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12012 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-03-27 02:09:16 +00:00
parent 6a4febe201
commit cbc2d07d59

View File

@ -1,4 +1,4 @@
#!/bin/sh -vx
#!/bin/sh
# IBM(c) 2008 EPL license http://www.eclipse.org/legal/epl-v10.html
# Sample xCAT post script for configuring secondary adatper based on eth0
@ -52,9 +52,42 @@ if [ $PLTFRM == "Linux" ]
then
ib_number=`lspci | grep -i InfiniBand | wc -l`
loop_number=$[ $ib_number * 2 ]
#loop_number=$[ $loop_number - 1 ]
loop_number=`expr $ib_number \* 2`
if [ -f /etc/redhat-release ]
then
OS_name="redhat"
elif [ -f /etc/SuSE-release ]
then
OS_name="suse"
else
echo "Unsupported to config IB on this OS!"
exit
fi
if [ $OS_name == 'suse' ]
then
dir="/etc/sysconfig/network"
else
dir="/etc/sysconfig/network-scripts"
fi
`rm -f $dir/ifcfg-ib*`
else
loop_number=`lsdev | grep "IP over Infiniband Network Interface" | wc -l`
num=0
#for (( num = 0; num < loop_number; num++ ))
while [ $num -lt $loop_number ]
do
num1=`expr $num % 2`
`rmdev -d -l ib$num`
`rmdev -d -l ml$num1`
num=`expr $num + 1`
done
loop_number=`lsdev -Cc adapter |grep iba |wc -l`
fi
@ -62,8 +95,9 @@ fi
HOST=`hostname -s`
num=0
#ifor num in 0 1
for (( num=0; num<$loop_number; num++))
while [ $num -lt $loop_number ]
do
# Take primary node name, add -ib$num and then reverse resolve to get what ip should be
nic="ib$num"
@ -169,6 +203,7 @@ GATEWAY=$gateway" > $dir/ifcfg-$nic
mkiba -a $ip -i $nic -A $ib_adapter -p $port -P -1 -S up -m $netmask
fi
fi
num=`expr $num + 1`
done
# Bringup all the ib interfaces
@ -177,8 +212,9 @@ then
/sbin/service $ib_driver restart
num=0
#for num in 0 1
for (( num=0; num<$loop_number; num++))
while [ $num -lt $loop_number ]
do
sleep 5
@ -188,6 +224,7 @@ then
else
ifup ib$num
fi
num=`expr $num + 1`
done
fi