diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index d5377e6ec..0755f5bfc 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -518,6 +518,13 @@ sub makescript { ## kit and kitcomponent parameter. my $kitcomp_deployparams = getKitcompDeployParams($osimgname,\%image_hash); + # get mac address for the node + my $macaddress; + if( defined( $::GLOBAL_TAB_HASH{mac}) && defined( $::GLOBAL_TAB_HASH{mac}{$node}) ) { + my $macmac = $::GLOBAL_TAB_HASH{mac}{$node}{mac}; + $macaddress = xCAT::Utils->parseMacTabEntry($macmac, $node); + } + #ok, now do everything else.. #$inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg; #$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; @@ -545,6 +552,8 @@ sub makescript { #$inc =~ s/#COMMAND:([^#]+)#/command($1)/eg; $inc =~ s/\$NTYPE/$nodetype/eg; + $inc =~ s/\$MACADDRESS/$macaddress/eg; + # This line only is used to compatible with the old code $inc =~ s/#Subroutine:([^:]+)::([^:]+)::([^:]+):([^#]+)#/runsubroutine($1,$2,$3,$4)/eg; diff --git a/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl b/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl index 74e9367bf..88a5bb8dc 100755 --- a/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl +++ b/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl @@ -77,9 +77,11 @@ export UPDATENODE NTYPE=$NTYPE export NTYPE -MACADDRESS=#TABLE:mac:$NODE:mac# -export MACADDRESS +MACMAC=#TABLE:mac:$NODE:mac# +export MACMAC +MACADDRESS=$MACADDRESS +export MACADDRESS ## vlan related items. vlan may not be configured. #VLAN_VARS_EXPORT#