summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-05-28 10:09:12 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-05-28 10:09:12 +0000
commit1d445950582373c6240ce59f70f63837121131aa (patch)
treeb3ce898c9be92bd2f1763e4471b0c3a427457b24 /perl-install
parente9c2fd6362eca835dbaffb59477a10f8e3e244f0 (diff)
downloaddrakx-backup-do-not-use-1d445950582373c6240ce59f70f63837121131aa.tar
drakx-backup-do-not-use-1d445950582373c6240ce59f70f63837121131aa.tar.gz
drakx-backup-do-not-use-1d445950582373c6240ce59f70f63837121131aa.tar.bz2
drakx-backup-do-not-use-1d445950582373c6240ce59f70f63837121131aa.tar.xz
drakx-backup-do-not-use-1d445950582373c6240ce59f70f63837121131aa.zip
(get_eth_cards) fallback on sysfs in order to get driver and card
description when ethtool is not supported (eg: ipw2100 driver for intel centrino)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/ethernet.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index 193bbf539..a6e58df1b 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -63,6 +63,17 @@ sub get_eth_cards() {
($description) = (mapIntfToDevice($interface))[0]->{description};
}
if (!$description) {
+ my $drv = readlink("/sys/class/net/$interface/driver");
+ if ($drv and $drv =~ s!.*/!!) {
+ $a = $drv;
+ my %l;
+ my %sysfs_fields = (id => "device", subid => "subsystem_device", vendor => "vendor", subvendor => "subsystem_vendor");
+ $l{$_} = hex(chomp_(cat_("/sys/class/net/$interface/device/" . $sysfs_fields{$_}))) foreach keys %sysfs_fields;
+ my @cards = grep { my $dev = $_; every { $dev->{$_} eq $l{$_} } keys %l } detect_devices::probeall();
+ $description = $cards[0]{description} if $#cards == 0;
+ }
+ }
+ if (!$description) {
my @cards = grep { $_->{driver} eq ($a || $saved_driver) } detect_devices::probeall();
$description = $cards[0]->{description} if $#cards == 0;
}