From 90b67fb8141bcb31adc0333a0c7e6e4b313a9e1a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 1 Sep 2008 16:23:49 +0000 Subject: allow to skip system config aliases when resolving modaliases --- perl-install/modalias.pm | 12 ++++++++---- 1 file 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)) { -- cgit v1.2.1