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
This commit is contained in:
parent
f39a45518e
commit
6fad417a52
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user