defect 3287:avoid to running gettyset for sles11 and higher

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14888 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2013-01-15 13:11:41 +00:00
parent 3fd2310ec6
commit fcd6182b3d

View File

@ -1308,7 +1308,12 @@ EOMS
close($inifile);
open($inifile,">"."/tmp/xcatinitrd.$$/bin/netstart");
print $inifile "#!/bin/bash \n";
print $inifile "dhcpcd \${1} -p\n";
if ($osver_host == 10) {
print $inifile "dhcpcd \${1}\n";
} else { # for sles11 or higher
# -p is used to keep the network connection during the shutdown. Used for nfs-based statelite shutdown
print $inifile "dhcpcd \${1} -p\n";
}
#-- Bring other NICs up in /bin/netstart in initrd for NIC failover
foreach (split /,/,$othernics) {
@ -1570,6 +1575,14 @@ sub generic_post { # This function is meant to leave the image in a state approx
print $cfgfile "# Short-Description: gettyset\n";
print $cfgfile "# Description:\n";
print $cfgfile "### END INIT INFO\n";
print $cfgfile "VERS=`grep VERSION /etc/SuSE-release`\n";
print $cfgfile "if [ -n \"\$VERS\" ]; then\n";
print $cfgfile " VERNUM=`echo \$VERS|awk -F= \'{print \$2}\'|sed -e \'s/ //g\'`\n";
print $cfgfile "fi\n";
print $cfgfile "if [ \"\$VERNUM\" -gt 10 ]; then\n";
print $cfgfile " exit\n";
print $cfgfile "fi\n";
print $cfgfile "\n";
print $cfgfile "for i in `cat /proc/cmdline`; do\n";
print $cfgfile ' KEY=`echo $i|cut -d= -f 1`' . "\n";
print $cfgfile " if [ \"\$KEY\" == \"console\" -a \"\$i\" != \"console=tty0\" ]; then\n";