2009-05-12 20:14:28 +00:00
|
|
|
#
|
|
|
|
# Setup hostname
|
|
|
|
#
|
|
|
|
echo "post scripts" >/root/post.log
|
2010-05-04 18:22:41 +00:00
|
|
|
export PRINIC=#TABLEBLANKOKAY:noderes:THISNODE:primarynic#
|
2009-05-12 20:14:28 +00:00
|
|
|
if [ -z "$PRINIC" ]
|
|
|
|
then
|
2010-05-04 18:22:41 +00:00
|
|
|
for karg in $(cat /proc/cmdline |sed -e 's/ /\n/g'); do
|
|
|
|
if [ "${karg%%=*}" = "BOOTIF" ]; then
|
|
|
|
export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=}"|awk '{print $1}'`
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$PRINIC" ]; then
|
|
|
|
export PRINIC=eth0
|
|
|
|
fi
|
2009-05-12 20:14:28 +00:00
|
|
|
fi
|
|
|
|
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
|
|
|
|
if [ -z $IP ]
|
|
|
|
then
|
|
|
|
dhclient eth0
|
|
|
|
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
|
|
|
|
fi
|
|
|
|
echo "search #TABLE:site:key=domain:value#" >/etc/resolv.conf
|
|
|
|
for i in $(echo #TABLE:site:key=nameservers:value# | tr ',' ' ')
|
|
|
|
do
|
|
|
|
echo "nameserver $i"
|
|
|
|
done >>/etc/resolv.conf
|
|
|
|
|
|
|
|
hostname $HOSTNAME
|
|
|
|
#
|
|
|
|
# Run xCAT post install
|
|
|
|
#
|
|
|
|
export MASTER_IP="#XCATVAR:XCATMASTER#"
|
|
|
|
export MASTER_IPS="#XCATVAR:XCATMASTER#"
|
|
|
|
export MASTER="#XCATVAR:XCATMASTER#"
|
|
|
|
cd /tmp
|
|
|
|
mkdir -p /xcatpost
|
2009-05-21 20:20:36 +00:00
|
|
|
service portmap start
|
|
|
|
ifconfig
|
|
|
|
cat /etc/resolv.conf
|
2009-05-12 20:14:28 +00:00
|
|
|
mount $MASTER_IP:/install/postscripts /xcatpost
|
|
|
|
cd /xcatpost
|
|
|
|
export PATH=/xcatpost:$PATH
|
|
|
|
export NODE=#TABLE:nodelist:THISNODE:node#
|
|
|
|
export OSVER=#TABLE:nodetype:THISNODE:os#
|
|
|
|
export ARCH=#TABLE:nodetype:THISNODE:arch#
|
|
|
|
syslog
|
2009-05-21 21:03:02 +00:00
|
|
|
#remoteshell this has been added in setupesx
|
|
|
|
setupntp
|
2009-05-12 20:14:28 +00:00
|
|
|
setupesx $HOSTNAME
|
2009-05-21 20:20:36 +00:00
|
|
|
updateflag.awk $MASTER #TABLE:site:key=xcatiport:value#
|
2009-05-12 20:14:28 +00:00
|
|
|
umount /xcatpost
|
|
|
|
cd /
|
|
|
|
exit 0
|