diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index b06039553..4670db4a7 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -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";