diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index aea3026af..afef1a54b 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -213,7 +213,7 @@ sub subvars { my $tempstr = "%inlcude /tmp/partitionfile\n"; $inc =~ s/#XCAT_PARTITION_START#[\s\S]*#XCAT_PARTITION_END#/$tempstr/; #modify the content in the file, and write into %pre part - $partcontent = "cat > /tmp/partscript << EOF\n" . $partcontent . "\nEOF\n"; + $partcontent = "cat > /tmp/partscript << EOFEOF\n" . $partcontent . "\nEOFEOF\n"; $partcontent .= "chmod 755 /tmp/partscript\n"; $partcontent .= "/tmp/partscript\n"; #replace the #XCA_PARTITION_SCRIPT# @@ -221,11 +221,11 @@ sub subvars { } #for sles/suse elsif ($inc =~ //){ - $partcontent = "cat > /tmp/partscript << EOF\n" . $partcontent . "\nEOF\n"; + my $tempstr = "XCATPARTITIONTEMP"; + $inc =~ s/[\s\S]*/$tempstr/; + $partcontent = "cat > /tmp/partscript << EOFEOF\n" . $partcontent . "\nEOFEOF\n"; $partcontent .= "chmod 755 /tmp/partscript\n"; $partcontent .= "/tmp/partscript\n"; - $partcontent .= "PARTDEF=`cat /tmp/partitionfile`\n"; - $partcontent .= "sed -e 's/[\s\S]*/\${PARTDEF}/' /tmp/profile/autoinst.xml > /tmp/profile/modified.xml"; $inc =~ s/#XCA_PARTITION_SCRIPT#/$partcontent/; } }