diff options
author | Olivier Blin <blino@mageia.org> | 2013-05-07 01:45:51 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2013-05-07 01:45:51 +0000 |
commit | c855efedb09110b41219d5c9fb61bb8753a1aef5 (patch) | |
tree | 0ae96d219a279ec4b959918dfaa216543de2ecc8 /perl-install/harddrake/autoconf.pm | |
parent | c12736224ec5d7b0a6fd745fa0b0cd657ecf73a1 (diff) | |
download | drakx-c855efedb09110b41219d5c9fb61bb8753a1aef5.tar drakx-c855efedb09110b41219d5c9fb61bb8753a1aef5.tar.gz drakx-c855efedb09110b41219d5c9fb61bb8753a1aef5.tar.bz2 drakx-c855efedb09110b41219d5c9fb61bb8753a1aef5.tar.xz drakx-c855efedb09110b41219d5c9fb61bb8753a1aef5.zip |
harddrake service: install ethernet/wireless packages when a new
device is detected, this shoud help for Broadcom devices
Diffstat (limited to 'perl-install/harddrake/autoconf.pm')
-rw-r--r-- | perl-install/harddrake/autoconf.pm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/perl-install/harddrake/autoconf.pm b/perl-install/harddrake/autoconf.pm index a82446db6..de54451ad 100644 --- a/perl-install/harddrake/autoconf.pm +++ b/perl-install/harddrake/autoconf.pm @@ -24,10 +24,36 @@ sub xconf { modules::load_category($modules_conf, 'various/agpgart'); } +sub setup_ethernet_device { + my ($in, $device) = @_; + + require network::connection; + require network::connection::ethernet; + require network::connection::wireless; + my @connection_types = qw(network::connection::ethernet network::connection::wireless); + my @all_connections = map { $_->get_connections(automatic_only => 1) } @connection_types; + my $interface = network::connection::ethernet::device_to_interface($device) + or return; + my $connection = find { $_->get_interface eq $interface } @all_connections + or return; + + require network::connection_manager; + my $net = {}; + network::network::read_net_conf($net); + my $cmanager = network::connection_manager->new($in, $net, undef, undef); + $cmanager->set_connection($connection); + + # this will installed required packages + $cmanager->setup_connection; +} + sub network_conf { - my ($modules_conf) = @_; + my ($modules_conf, $in, $added) = @_; $modules_conf->remove_alias_regexp('^(wlan|eth)[0-9]*$'); modules::load_category($modules_conf, 'network/main|gigabit|usb|wireless|firewire|pcmcia'); + + setup_ethernet_device($in, $_) foreach @{$added || {}}; + require network::connection::ethernet; network::connection::ethernet::configure_eth_aliases($modules_conf); require network::rfswitch; |