From 04cb7483c6766d5c8c4dbfa109f32e448e84aeae Mon Sep 17 00:00:00 2001 From: angli-xcat Date: Mon, 27 Jun 2011 03:46:29 +0000 Subject: [PATCH] This is for SLES 11 SP1 SDK DVD support ==================================================================== Target Dist: SLES 11 SP1, for both full install and statelite install Aim: To enable users to install packages from SDK DVD during installation user impact: If the user add packages in .pkglist files, he/she should first do 'copycds' using SDK DVD iso. By-effect: N/A Limitations: 2nd installation DVD and 2nd SDK DVD not supported, both carries source packages. It seems they are not recognized by autoyast, and it's of no use to install sources pkgs on CNs. ==================================================================== git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9939 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 11 +++++++++++ xCAT-server/lib/xcat/plugins/sles.pm | 8 ++++++-- .../share/xcat/install/sles/compute.sles11.tmpl | 11 +++++++++++ xCAT-server/share/xcat/netboot/sles/genimage | 6 ++++++ 4 files changed, 34 insertions(+), 2 deletions(-) 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"); }