From 711f5de8e5b97a6c22fa35b371cf95592cde5819 Mon Sep 17 00:00:00 2001 From: phamt Date: Mon, 23 Aug 2010 15:41:08 +0000 Subject: [PATCH] Added postscript support to zvm. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7190 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 27 ++++++++++++++++--- .../xcat/install/rh/compute.rhel5.s390x.tmpl | 3 +-- .../xcat/install/scripts/post.rhel5.s390x | 1 + .../xcat/install/scripts/post.sles10.s390x | 22 +++++++++++++++ .../xcat/install/scripts/post.sles11.s390x | 18 +++++++++++++ .../install/sles/compute.sles10.s390x.tmpl | 22 --------------- .../install/sles/compute.sles11.s390x.tmpl | 18 ------------- 7 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 xCAT-server/share/xcat/install/scripts/post.rhel5.s390x create mode 100644 xCAT-server/share/xcat/install/scripts/post.sles10.s390x create mode 100644 xCAT-server/share/xcat/install/scripts/post.sles11.s390x diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 4cb7669d6..807648b42 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -3026,6 +3026,19 @@ sub nodeSet { my $portName = "FOOBAR"; my $portNo = "0"; + # Get postscript content + my $postScript; + if ( $os =~ m/sles10/i ) { + $postScript = "/opt/xcat/share/xcat/install/scripts/post.sles10.s390x"; + } elsif ( $os =~ m/sles11/i ) { + $postScript = "/opt/xcat/share/xcat/install/scripts/post.sles11.s390x"; + } elsif ( $os =~ m/rhel5/i ) { + $postScript = "/opt/xcat/share/xcat/install/scripts/post.rhel5.s390x"; + } else { + xCAT::zvmUtils->printLn( $callback, "$node: (Error) No postscript available for $os" ); + return; + } + # SUSE installation my $customTmpl; if ( $os =~ m/sles/i ) { @@ -3039,10 +3052,13 @@ sub nodeSet { $out = `cp $installDir/custom/install/sles/$tmpl $customTmpl`; } else { - xCAT::zvmUtils->printLn( $callback, "$node: (Error) An autoyast template does not exist for $os" ); + xCAT::zvmUtils->printLn( $callback, "$node: (Error) An autoyast template does not exist for $os in $installDir/custom/install/sles/" ); return; } - + + # Copy postscript into template + $out = `sed --in-place -e "//r $postScript" $customTmpl`; + # Edit template my $device; my $chanIds = "$readChannel $writeChannel $dataChannel"; @@ -3171,10 +3187,13 @@ sub nodeSet { $out = `cp $installDir/custom/install/rh/$tmpl $customTmpl`; } else { - xCAT::zvmUtils->printLn( $callback, "$node: (Error) An kickstart template does not exist for $os" ); + xCAT::zvmUtils->printLn( $callback, "$node: (Error) An kickstart template does not exist for $os in $installDir/custom/install/rh/" ); return; } - + + # Copy postscript into template + $out = `sed --in-place -e "/%post/r $postScript" $customTmpl`; + # Edit template my $url = "ftp://$ftp/$os/s390x/"; $out = diff --git a/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl index e2fd652dd..5807bd454 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel5.s390x.tmpl @@ -24,5 +24,4 @@ part / --fstype ext3 --size=100 --grow --ondisk=dasda %packages #INCLUDE_DEFAULT_PKGLIST# -%post -echo ARP=no >> /etc/sysconfig/network-scripts/ifcfg-eth0 +%post \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/scripts/post.rhel5.s390x b/xCAT-server/share/xcat/install/scripts/post.rhel5.s390x new file mode 100644 index 000000000..d4ea0f703 --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/post.rhel5.s390x @@ -0,0 +1 @@ +echo ARP=no >> /etc/sysconfig/network-scripts/ifcfg-eth0 \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/scripts/post.sles10.s390x b/xCAT-server/share/xcat/install/scripts/post.sles10.s390x new file mode 100644 index 000000000..23b3ed55d --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/post.sles10.s390x @@ -0,0 +1,22 @@ + + + \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/scripts/post.sles11.s390x b/xCAT-server/share/xcat/install/scripts/post.sles11.s390x new file mode 100644 index 000000000..ed5dfed12 --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/post.sles11.s390x @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/sles/compute.sles10.s390x.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles10.s390x.tmpl index 67d44c16a..fe3bc2fc9 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles10.s390x.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles10.s390x.tmpl @@ -880,28 +880,6 @@ - - - diff --git a/xCAT-server/share/xcat/install/sles/compute.sles11.s390x.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles11.s390x.tmpl index 5f0fdba4c..f835b9fe3 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles11.s390x.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles11.s390x.tmpl @@ -880,24 +880,6 @@ - - -