From 03b23734204407d8bd140f7042267b909d450698 Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 21 Dec 2012 07:56:14 +0000 Subject: [PATCH] fixed bug 3264 , support the multiple paths for osimage.pkgdir in the sles11 genimage git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14695 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 29 +++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 3c4e8c237..b06039553 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -127,7 +127,7 @@ unless ($arch) { $srcdir="$installroot/$osver/$arch" unless ($srcdir); $updates{'pkgdir'} = $srcdir if ($tempfile); -$srcdir = $srcdir . "/1"; +#$srcdir = $srcdir . "/1"; $srcdir_otherpkgs = "$installroot/post/otherpkgs/$osver/$arch" unless ($srcdir_otherpkgs); $updates{'otherpkgdir'} = $srcdir_otherpkgs if ($tempfile); @@ -246,19 +246,34 @@ unless ($onlyinitrd) { if (!$prompt) { $non_interactive="--non-interactive --no-gpg-checks"; } if($osver_host == 11) {#zypper in SLES11 is different - if(-e "$rootimg_dir/etc/zypp/repos.d/$osver.repo") { - system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver.repo"); - } - system("zypper -R $rootimg_dir $non_interactive 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"); + + system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver-*.repo"); + my @pkgdirs = split(",", $srcdir); + my $dir; + my $i = 0; + # To support multiple paths for osimage.pkgdir + foreach $dir (@pkgdirs) { + if( -d "$dir/1") { + $dir .= "/1"; + } + system("zypper -R $rootimg_dir $non_interactive ar file:$dir $osver-$i"); + $i++; } + + #if(-e "$rootimg_dir/etc/zypp/repos.d/$osver.repo") { + # system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver.repo"); + #} + #system("zypper -R $rootimg_dir $non_interactive 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"; if ( -e "$srcdir_sdk") { system("zypper -R $rootimg_dir $non_interactive ar file:$srcdir_sdk ${osver}sdk"); } }else { + $srcdir = $srcdir . "/1"; system("zypper -R $rootimg_dir $non_interactive sa file:$srcdir"); }