From 179d0c4cc26b53de4a3f0b6e0d455a31c7f1b5e3 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Thu, 12 Jul 2012 10:26:10 +0000 Subject: [PATCH] specify partition definition: support script for sles git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13285 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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/; } }