From 7ebfabefe236fb3e2f8082a8bbbb7c9e58eeec30 Mon Sep 17 00:00:00 2001 From: zhanx Date: Fri, 23 Jan 2009 07:18:55 +0000 Subject: [PATCH] fix 2 issues: [1]. In the file /etc/infiniband/openib.conf, change the line SDP_LOAD=yes to SDP_LOAD=no. [2]. Run 'chkconfig --level 2345 openibd on' git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2646 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/ib/scripts/configiba | 36 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/configiba b/xCAT-server/share/xcat/ib/scripts/configiba index f5033a6c7..c0d823509 100644 --- a/xCAT-server/share/xcat/ib/scripts/configiba +++ b/xCAT-server/share/xcat/ib/scripts/configiba @@ -24,20 +24,50 @@ foreach my $num (@nums) { my $gateway = "$first.$second.255.254"; if ($PLTFRM eq "Linux") { + # Issue openibd for Linux at boot time + my $OS_name; + if ( -f '/etc/redhat-release') + { + $OS_name = "redhat"; + } + elsif ( -f '/etc/SuSE-release') + { + $OS_name = "suse"; + } + else + { + print "Unsupported to config IB on this OS!\n"; + exit; + } + if ( -f "/etc/infiniband/openib.conf") + { + runcmd("/usr/bin/sed -i 's/SDP_LOAD=yes/SDP_LOAD=no/g' /etc/infiniband/openib.conf"); + } + my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on"; + runcmd($openibd_cmd); # Write the info to the ifcfg file - my $dir = "/etc/sysconfig/network-scripts"; + my $dir; + if ( $OS_name eq 'suse') + { + $dir = "/etc/sysconfig/network"; + } + elsif ( $OS_name eq 'redhat') + { + $dir = "/etc/sysconfig/network-scripts"; + } if (!open(FILE, ">$dir/ifcfg-$nic")) { system("logger -t xcat 'configiba: cannot open $dir/ifcfg-$nic.'"); exit 1; } print FILE "DEVICE=$nic\n"; print FILE "BOOTPROTO=none\n"; print FILE "IPADDR=$ip\n"; print FILE "NETMASK=$netmask\n"; print FILE "GATEWAY=$gateway\n"; - print FILE "ONBOOT=yes\n"; + print FILE "ONBOOT=yes\n" if ( $OS_name eq 'redhat'); + print FILE "STARTMODE=auto\n" if ( $OS_name eq 'suse'); close FILE; runcmd("$dir/ifup $nic"); system("logger -t xcat 'configiba: successfully configured $nic.'"); } elsif ($PLTFRM eq "AIX") { - #Check whether the icm is available + #Check whether the icm is available my $cmd = "lsdev -C | grep icm | grep Available"; `$cmd`; if ($?) {