diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-09-01 16:23:49 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-09-01 16:23:49 +0000 |
commit | 90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a (patch) | |
tree | 8d5196dbbf04c667793fe51c08d94cd4cd94db10 | |
parent | 27e3b71aa1c30edbd21bebf0da8fea326905850b (diff) | |
download | drakx-90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a.tar drakx-90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a.tar.gz drakx-90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a.tar.bz2 drakx-90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a.tar.xz drakx-90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a.zip |
allow to skip system config aliases when resolving modaliases
-rw-r--r-- | perl-install/modalias.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/modalias.pm b/perl-install/modalias.pm index 86d2f0603..e1b61edc0 100644 --- a/perl-install/modalias.pm +++ b/perl-install/modalias.pm @@ -13,6 +13,8 @@ my @config_groups = ( "/etc/modprobe.conf", "/etc/modprobe.d", ], +); +my @system_groups = ( [ "/lib/module-init-tools/ldetect-lst-modules.alias", ], @@ -70,23 +72,25 @@ sub parse_file_modules { \%modules; } -sub get_alias_groups() { +sub get_alias_groups { + my ($o_skip_config) = @_; + #- FIXME: only o_skip_config from the first call is considered @alias_groups = map { my $group = {}; parse_path($group, $_) foreach @$_; $group; - } @config_groups unless @alias_groups; + } if_(!$o_skip_config, @config_groups), @system_groups unless @alias_groups; @alias_groups; } sub get_modules { - my ($modalias) = @_; + my ($modalias, $o_skip_config) = @_; my ($class) = $modalias =~ /^([^:]+):\S+$/; my ($vendor, $device) = alias_to_ids($modalias); $class && member($class, @classes) or return; require File::FnMatch; - foreach my $group (get_alias_groups()) { + foreach my $group (get_alias_groups($o_skip_config)) { my @aliases; foreach my $subgroup ($group->{$class}{$vendor}{$device}, $group->{$class}{other}) { foreach (group_by2(@$subgroup)) { |