diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 5fda49552..5e94d2f86 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -29,6 +29,7 @@ sub subvars { $tmplerr=undef; #clear tmplerr since we are starting fresh $node = shift; my $pkglistfile=shift; + my $media_dir = shift; my $outh; my $inh; @@ -115,7 +116,17 @@ sub subvars { $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; $inc =~ s/#HOSTNAME#/$node/eg; + if($media_dir =~ /sles11/){ + my $nrtab = xCAT::Table->new("noderes"); + my $tftpserver = $nrtab->getNodeAttribs($node, ['tftpserver']); + my $sles_sdk_media = "http://" . $tftpserver->{tftpserver} . $media_dir . "/1"; + system("find $media_dir|grep sdk1"); + if($? == 0){ + $sles_sdk_media =~ s/1$/sdk1/g; + } + $inc =~ s/#SLES_SDK_MEDIA#/$sles_sdk_media/eg; + } if ($tmplerr) { close ($outh); return $tmplerr; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index d97d4de6d..7e7612e95 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -671,7 +671,8 @@ sub mkinstall $tmplfile, "$installroot/autoinst/$node", $node, - $pkglistfile + $pkglistfile, + $pkgdir ); } @@ -981,7 +982,7 @@ sub copycd my $prod = <$mfile>; close($mfile); - if ($prod =~ m/SUSE-Linux-Enterprise-Server/) + if ($prod =~ m/SUSE-Linux-Enterprise-Server/ || $prod =~ m/SUSE-Linux-Enterprise-Software-Development-Kit/) { if (-f "$path/content") { my $content; @@ -1001,6 +1002,9 @@ sub copycd $detdistname = "sles" . $subparts[0]; unless ($distname) { $distname = "sles" . $subparts[0] }; } + if($prod =~ m/Software-Development-Kit/) { + $discnumber = 'sdk' . $discnumber; + } # check media.1/products for text. # the cselx is a special GE built version. # openSUSE is the normal one. diff --git a/xCAT-server/share/xcat/install/sles/compute.sles11.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles11.tmpl index ec0b2d54e..09e91c127 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles11.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles11.tmpl @@ -29,6 +29,17 @@ non + + + + #SLES_SDK_MEDIA# + SuSE-Linux-SDK + / + false + SuSE-Linux-SDK + + + /dev/sda diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index c14e3c440..376fadd69 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -349,6 +349,12 @@ unless ($onlyinitrd) { system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver.repo"); } system("zypper -R $rootimg_dir ar file:$srcdir $osver"); + + if(-e "$rootimg_dir/etc/zypp/repos.d/${osver}sdk.repo") { + system("rm -rf $rootimg_dir/etc/zypp/repos.d/${osver}sdk.repo"); + } + my $srcdir_sdk = "$installroot/$osver/$arch/sdk1"; + system("zypper -R $rootimg_dir ar file:$srcdir_sdk ${osver}sdk"); }else { system("zypper -R $rootimg_dir sa file:$srcdir"); }