defect 3803: appending the default drvier list even new driver is specified in netdrivers attr; change the output message of genimage

This commit is contained in:
daniceexi 2013-09-27 01:57:59 -04:00
parent 58e403c28c
commit 09fe6d5c8f
2 changed files with 41 additions and 31 deletions

View File

@ -174,15 +174,13 @@ if ($netdriver) {
}
}
# Use the default list if not specified
unless (@ndrivers) {
if ($arch eq 'x86' or $arch eq 'x86_64') {
@ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net be2net/;
} elsif ($arch eq 'ppc64') {
@ndrivers = qw/e1000 e1000e igb ibmveth ehea/;
} elsif ($arch eq 's390x') {
@ndrivers = qw/qdio ccwgroup/;
}
# Add the default driver list
if ($arch eq 'x86' or $arch eq 'x86_64') {
push @ndrivers, qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net be2net/;
} elsif ($arch eq 'ppc64') {
push @ndrivers, qw/e1000 e1000e igb ibmveth ehea/;
} elsif ($arch eq 's390x') {
push @ndrivers, qw/qdio ccwgroup/;
}
foreach (@ndrivers) {
@ -491,10 +489,6 @@ foreach my $dd (@dd_drivers) {
print "Added driver $dd from driver update disk or driver rpm\n";
}
foreach my $driver (@ndrivers) {
print "Added driver $driver from root image\n";
}
if (@new_order) {
@ndrivers = (@new_order, @ndrivers);
}
@ -514,14 +508,24 @@ while (scalar @checkdeps) {
foreach $dep (@deps) {
$dep =~ s/.*\///;
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift (@checkdeps,$dep); #recursively check dependencies
unshift (@ndrivers,$dep);
print "Added $dep as an autodetected depedency\n";
}
unshift (@checkdeps,$dep); #recursively check dependencies
unshift (@ndrivers,$dep);
}
}
}
close($moddeps);
#remove the duplicated drivers
my @fulldrivers;
foreach my $dn (@ndrivers) {
unless (grep {$_ eq $dn} @fulldrivers) {
push @fulldrivers, $dn;
}
}
@ndrivers = @fulldrivers;
unlink "/tmp/genimage.$$.yum.conf";
if (-d "$rootimg_dir/usr/share/dracut") {
$dracutmode = 1;
@ -770,7 +774,17 @@ sub mkinitrd_dracut {
# Add drivers to support local disk
push @ndrivers, "ext3";
push @ndrivers, "ext4";
#remove the duplicated drivers
my @fulldrivers;
foreach my $dn (@ndrivers) {
unless (grep {$_ eq $dn} @fulldrivers) {
push @fulldrivers, $dn;
}
}
@ndrivers = @fulldrivers;
my $add_drivers = join(' ', @ndrivers);
print "Try to load drivers: $add_drivers to initrd.\n";
my $DRACUTCONF;
if ($mode eq "statelite") {
@ -1529,6 +1543,7 @@ sub isnetdriver {
my $filetoadd = $File::Find::name;
$filetoadd =~ s!$rootimg_dir/!!;
push @filestoadd,[$filetoadd,"lib/$_"];
print "Added driver $_ to initrd\n";
}
}
}
@ -1889,7 +1904,7 @@ sub load_dd ()
system ("cp -rf $real_path $rootimg_dir$1");
push @rpm_drivers, $driver;
} else {
print "Error: cannot find the driver $driver from the driver rpms\n";
print "Warning: cannot find the driver $driver from the driver rpms\n";
}
}
} elsif ($Injectalldriver) {

View File

@ -173,15 +173,13 @@ if ($netdriver) {
}
}
# Use the default list if not specified
unless (@ndrivers) {
if ($arch eq 'x86' or $arch eq 'x86_64') {
@ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en be2net/;
} elsif ($arch eq 'ppc64') {
@ndrivers = qw/tg3 e1000 e1000e igb ibmveth ehea be2net/;
} elsif ($arch eq "s390x") {
@ndrivers = qw/qdio ccwgroup qeth qeth_l2 qeth_l3/;
}
# Add the default driver list
if ($arch eq 'x86' or $arch eq 'x86_64') {
push @ndrivers, qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en be2net/;
} elsif ($arch eq 'ppc64') {
push @ndrivers, qw/tg3 e1000 e1000e igb ibmveth ehea be2net/;
} elsif ($arch eq "s390x") {
push @ndrivers, qw/qdio ccwgroup qeth qeth_l2 qeth_l3/;
}
foreach (@ndrivers) {
@ -785,10 +783,6 @@ foreach my $dd (@dd_drivers) {
print "Added driver $dd from driver update disk or driver rpm\n";
}
foreach my $driver (@ndrivers) {
print "Added driver $driver from root image\n";
}
if (@new_order) {
@ndrivers = (@new_order, @ndrivers);
}
@ -1563,7 +1557,7 @@ EOMS
print "The initial ramdisk for statelite has been generated successfully!\n";
} else {
system("cd /tmp/xcatinitrd.$$;find .|cpio -H newc -o|gzip -9 -c - > $destdir/initrd-stateless.gz");
print "The initial ramdisk for statelite has been generated successfully!\n";
print "The initial ramdisk for stateless has been generated successfully!\n";
}
system("rm -rf /tmp/xcatinitrd.$$");
@ -1583,6 +1577,7 @@ sub isnetdriver {
my $filetoadd = $File::Find::name;
$filetoadd =~ s!$rootimg_dir!!;
push @filestoadd,[$filetoadd,"lib/$_"];
print "Added driver $_ to initrd\n";
}
}
}
@ -2001,7 +1996,7 @@ sub load_dd()
system ("cp -rf $real_path $rootimg_dir$1");
push @rpm_drivers, $driver;
} else {
print "Error: cannot find the driver $driver from the driver rpms\n";
print "Warning: cannot find the driver $driver from the driver rpms\n";
}
}
} elsif ($Injectalldriver) {