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
This commit is contained in:
parent
f16adeb627
commit
711f5de8e5
@ -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 "/<scripts>/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 =
|
||||
|
@ -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
|
1
xCAT-server/share/xcat/install/scripts/post.rhel5.s390x
Normal file
1
xCAT-server/share/xcat/install/scripts/post.rhel5.s390x
Normal file
@ -0,0 +1 @@
|
||||
echo ARP=no >> /etc/sysconfig/network-scripts/ifcfg-eth0
|
22
xCAT-server/share/xcat/install/scripts/post.sles10.s390x
Normal file
22
xCAT-server/share/xcat/install/scripts/post.sles10.s390x
Normal file
@ -0,0 +1,22 @@
|
||||
<post-scripts config:type="list">
|
||||
<script>
|
||||
<filename>post.sh</filename>
|
||||
<interpreter>shell</interpreter>
|
||||
<source>
|
||||
<![CDATA[
|
||||
#!/bin/sh
|
||||
|
||||
# Set MAC address
|
||||
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
|
||||
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
|
||||
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
|
||||
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
|
||||
|
||||
# Set layer = 2
|
||||
cat /etc/sysconfig/hardware/hwcfg-replace_device | grep -v "QETH_LAYER2_SUPPORT" > /tmp/hwcfg-replace_device
|
||||
echo "QETH_LAYER2_SUPPORT='1'" >> /tmp/hwcfg-replace_device
|
||||
cat /tmp/hwcfg-replace_device > /etc/sysconfig/hardware/hwcfg-replace_device
|
||||
]]>
|
||||
</source>
|
||||
</script>
|
||||
</post-scripts>
|
18
xCAT-server/share/xcat/install/scripts/post.sles11.s390x
Normal file
18
xCAT-server/share/xcat/install/scripts/post.sles11.s390x
Normal file
@ -0,0 +1,18 @@
|
||||
<post-scripts config:type="list">
|
||||
<script>
|
||||
<filename>post.sh</filename>
|
||||
<interpreter>shell</interpreter>
|
||||
<source>
|
||||
<![CDATA[
|
||||
#!/bin/sh
|
||||
|
||||
# Set MAC address
|
||||
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
|
||||
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
|
||||
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
|
||||
echo "NAME='OSA Express Network card (replace_nic_addr)'" >> /tmp/ifcfg-replace_device
|
||||
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
|
||||
]]>
|
||||
</source>
|
||||
</script>
|
||||
</post-scripts>
|
@ -880,28 +880,6 @@
|
||||
<!-- Scripts (post-script) -->
|
||||
<configure>
|
||||
<scripts>
|
||||
<post-scripts config:type="list">
|
||||
<script>
|
||||
<filename>post.sh</filename>
|
||||
<interpreter>shell</interpreter>
|
||||
<source>
|
||||
<![CDATA[
|
||||
#!/bin/sh
|
||||
|
||||
# Set MAC address
|
||||
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
|
||||
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
|
||||
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
|
||||
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
|
||||
|
||||
# Set layer = 2
|
||||
cat /etc/sysconfig/hardware/hwcfg-replace_device | grep -v "QETH_LAYER2_SUPPORT" > /tmp/hwcfg-replace_device
|
||||
echo "QETH_LAYER2_SUPPORT='1'" >> /tmp/hwcfg-replace_device
|
||||
cat /tmp/hwcfg-replace_device > /etc/sysconfig/hardware/hwcfg-replace_device
|
||||
]]>
|
||||
</source>
|
||||
</script>
|
||||
</post-scripts>
|
||||
</scripts>
|
||||
</configure>
|
||||
</profile>
|
||||
|
@ -880,24 +880,6 @@
|
||||
<!-- Scripts (post-script) -->
|
||||
<configure>
|
||||
<scripts>
|
||||
<post-scripts config:type="list">
|
||||
<script>
|
||||
<filename>post.sh</filename>
|
||||
<interpreter>shell</interpreter>
|
||||
<source>
|
||||
<![CDATA[
|
||||
#!/bin/sh
|
||||
|
||||
# Set MAC address
|
||||
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
|
||||
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
|
||||
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
|
||||
echo "NAME='OSA Express Network card (replace_nic_addr)'" >> /tmp/ifcfg-replace_device
|
||||
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
|
||||
]]>
|
||||
</source>
|
||||
</script>
|
||||
</post-scripts>
|
||||
</scripts>
|
||||
</configure>
|
||||
</profile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user