summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2013-05-07 01:45:51 +0000
committerOlivier Blin <blino@mageia.org>2013-05-07 01:45:51 +0000
commite54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7 (patch)
tree0ae96d219a279ec4b959918dfaa216543de2ecc8
parent2da6683219698f9ef15c5ccca5c6a6807669b235 (diff)
downloaddrakx-backup-do-not-use-e54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7.tar
drakx-backup-do-not-use-e54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7.tar.gz
drakx-backup-do-not-use-e54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7.tar.bz2
drakx-backup-do-not-use-e54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7.tar.xz
drakx-backup-do-not-use-e54e0b99ed4d1eb8a617eb19f54622fa6cf4f7b7.zip
harddrake service: install ethernet/wireless packages when a new
device is detected, this shoud help for Broadcom devices
-rw-r--r--perl-install/NEWS4
-rw-r--r--perl-install/harddrake/autoconf.pm28
-rwxr-xr-xperl-install/standalone/service_harddrake4
3 files changed, 33 insertions, 3 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 50c1efc0f..3e100f460 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,7 +1,9 @@
-- harddrake:
+- harddrake service:
o do not disable bluetooth service if adapter disappears
(for example if disabled by Fn keys)
systemd will automatically disable the service if needed
+ o install ethernet/wireless packages when a new device is detected,
+ this shoud help for Broadcom devices
Version 15.47 - 30 April 2013
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;
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index fd86fb4f2..c661468f3 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -320,7 +320,9 @@ foreach my $hw_class (@harddrake::data::tree) {
harddrake::sound::configure_sound_slots($modules_conf);
next;
} elsif ($Ident eq "ETHERNET") {
- harddrake::autoconf::network_conf($modules_conf);
+ require interactive;
+ $in ||= interactive->vnew;
+ harddrake::autoconf::network_conf($modules_conf, $in, [ @ID{@added} ]);
next;
} elsif (member($Ident, qw(ATA_STORAGE CARD_READER RAID_STORAGE SATA_STORAGE SCSI_CONTROLLER))) {
# set scsi_hostadapter in modprobe.conf: