From e5f6a985ee678a0c56d9807f60c6e05bcbafd161 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 15 Jan 2013 13:19:00 +0000 Subject: [PATCH] defect 3287:avoid to running gettyset for sles11 and higher git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14889 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 696abccd1..33e670666 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -1258,7 +1258,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) { @@ -1511,6 +1516,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";