diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-04-19 16:04:10 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-04-19 16:04:10 +0000 |
commit | e0f4d280b956d5a21e58094d1ff3550881a35dee (patch) | |
tree | 501bdd7bb26a4a6410a4cfc797de6af306cb313e /perl-install/network/tools.pm | |
parent | e88b5cff26aeeb3b83344d8b5ef393e046978bf8 (diff) | |
download | drakx-e0f4d280b956d5a21e58094d1ff3550881a35dee.tar drakx-e0f4d280b956d5a21e58094d1ff3550881a35dee.tar.gz drakx-e0f4d280b956d5a21e58094d1ff3550881a35dee.tar.bz2 drakx-e0f4d280b956d5a21e58094d1ff3550881a35dee.tar.xz drakx-e0f4d280b956d5a21e58094d1ff3550881a35dee.zip |
do not show empty ndiswrapper devices list
Diffstat (limited to 'perl-install/network/tools.pm')
-rw-r--r-- | perl-install/network/tools.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index de3f8a4b5..9c5ea152c 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -304,4 +304,21 @@ sub ndiswrapper_available_drivers() { `ndiswrapper -l` =~ /(\w+)\s+driver present, hardware present/mg; } +sub ndiswrapper_setup() { + modules::unload("ndiswrapper"); + #- unload ndiswrapper first so that the newly installed .inf files will be read + modules::load("ndiswrapper"); + + #- FIXME: move this somewhere in get_eth_cards, so that configure_eth_aliases correctly writes ndiswrapper + #- find the first interface matching an ndiswrapper driver, try ethtool then sysfs + my @available_drivers = network::tools::ndiswrapper_available_drivers(); + my $ntf_name = find { + my $drv = c::getNetDriver($_) || readlink("/sys/class/net/$_/driver"); + $drv =~ s!.*/!!; + member($drv, @available_drivers); + } detect_devices::getNet(); + #- fallback on wlan0 + return $ntf_name || "wlan0"; +} + 1; |