From 6fad417a5229dd9f12fb269a91083605b2216135 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 19 Dec 2012 08:56:12 +0000 Subject: [PATCH] support multiple path of ospkgdir in rhels genimage git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14685 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/rh/genimage | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index fde28ceb0..09e5ac6b6 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -16,7 +16,6 @@ use File::Find; use Getopt::Long; use Cwd qw(realpath); use File::Temp qw/mkdtemp/; -use xCAT::Table; use FindBin; use lib "$FindBin::Bin/../imgutils"; use imgutils; @@ -195,29 +194,13 @@ foreach (@ndrivers) { unless ($onlyinitrd) { @yumdirs=(); - if( $imagename ) { - my $linuximagetab = xCAT::Table->new('linuximage'); - unless ($linuximagetab){ - print "Unable to open linuximage table"; - exit 1; + my @pkgdirs = split(",", $srcdir); + my $dir; + foreach $dir (@pkgdirs) { + find(\&isyumdir, <$dir/>); + if (!grep /$dir/, @yumdirs) { + print "The repository for $dir should be created before running the genimge. Try to run [createrepo $dir].\n"; } - - my $ent = $linuximagetab->getAttribs({'imagename' => "$imagename"}, ['pkgdir']); - my $pkgdir = $ent->{'pkgdir'}; - if( !defined($pkgdir) ) { - $pkgdir = "$installroot/$osver/$arch/"; - } - my @pkgdirs = split(",", $pkgdir); - my $dir; - foreach $dir (@pkgdirs) { - find(\&isyumdir, <$dir/>); - if (!grep /$dir/, @yumdirs) { - print "The repository for $dir should be created before running the genimge. Try to run [createrepo $dir].\n"; - } - } - - } else { - find(\&isyumdir, <$installroot/$osver/$arch/>); } # Add the dir for kernel rpm to be installed @@ -242,6 +225,7 @@ unless ($onlyinitrd) { $repnum-=1; close($yumconfig); mkpath "$rootimg_dir/etc"; + my $fd; open($fd,">>","$rootimg_dir/etc/fstab");