From 1d37bfdbbe874abd6dcb5563eea19f531de09e1c Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 25 May 2007 15:39:46 +0000 Subject: sync with 2007.1 (because of SVN loss) --- lib/network/rfswitch.pm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/network/rfswitch.pm (limited to 'lib/network/rfswitch.pm') diff --git a/lib/network/rfswitch.pm b/lib/network/rfswitch.pm new file mode 100644 index 0000000..4617990 --- /dev/null +++ b/lib/network/rfswitch.pm @@ -0,0 +1,38 @@ +package network::rfswitch; + +use strict; +use MDK::Common; +use detect_devices; + +my $conf_file = "/etc/modprobe.d/rfswitch.conf"; + +my @settings = ( + { + match => sub { + # CL56, with buggy BIOS + detect_devices::dmidecode_category('BIOS')->{Vendor} eq 'COMPAL' && + detect_devices::dmidecode_category('System')->{'Product Name'} eq ''; + }, + module => 'acerhk', + options => 'usedritek=1 autowlan=1 force_series=290', + install => 'echo 1 > /proc/driver/acerhk/wirelessled', + remove => 'echo 0 > /proc/driver/acerhk/wirelessled', + }, +); + +sub configure() { + my $setting = find { $_->{match}->() } @settings; + if ($setting) { + output_p($::prefix . $conf_file, + join("\n", + if_($setting->{options}, "options $setting->{module} $setting->{options}"), + if_($setting->{install}, "install $setting->{module} /sbin/modprobe --first-time --ignore-install $setting->{module} && $setting->{install}"), + if_($setting->{remove}, "remove $setting->{module} $setting->{remove}; /sbin/modprobe -r --ignore-remove $setting->{module}"), + "", + )); + require modules; + modules::set_preload_modules('rfswitch', $setting->{module}); + } +} + +1; -- cgit v1.2.1