diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index 7945769c4..c123af333 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -580,6 +580,18 @@ sub makescript } } + # SLES sdk + if ($os =~ /sles.*/) + { + my $installdir = $::XCATSITEVALS{'installdir'} ? $::XCATSITEVALS{'installdir'} : "/install"; + my $sdkdir = "$installdir/$os/$arch/sdk1"; + if (-e "$sdkdir") + { + push @scriptd, "SDKDIR='" . $sdkdir . "'\n"; + push @scriptd, "export SDKDIR\n"; + } + } + # check if there are sync files to be handled my $syncfile; if ( ($provmethod) diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index c2b4123d3..0a8354d7e 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -85,6 +85,12 @@ if [ -z "$OSPKGDIR" ]; then fi fi +if [ "$SDKDIR" != "" ]; then + if [ $mounted -eq 0 ]; then + SDKDIR="$NFSSERVER/$SDKDIR" + fi +fi + if [ $mounted -eq 0 ]; then OSPKGDIR_NO_PREFIX=${OSPKGDIR#$INSTALLDIR} @@ -277,6 +283,20 @@ elif ( pmatch "$OSVER" "sles11*" ); then echo "ospkgs: zypper ar $path $OSVER" echo " $result" fi + + if [ "$SDKDIR" != "" ]; then + if [ $mounted -eq 0 ]; then + SDKDIR="http://$SDKDIR" + else + SDKDIR="file://$SDKDIR" + fi + result=`zypper ar $SDKDIR $OSVER-sdk` + if [ $? -ne 0 ]; then + logger -t xcat "ospkgs: zypper ar $SDKDIR $OSVER-sdk\n $result" + echo "ospkgs: zypper ar $SDKDIR $OSVER-sdk" + echo " $result" + fi + fi result=`zypper --non-interactive refresh 2>&1` if [ $debug -ne 0 ]; then