diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-10-04 18:00:33 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-10-04 18:00:33 +0000 |
commit | 94e692bd9c9263deaccc62c4f39244db6c67c15c (patch) | |
tree | 5fbcc81f5d269448aa6e61e83e7bab6494a1f74e /convert | |
parent | 31e32c23c32fe5330fc2e935c1b248f4f2d31374 (diff) | |
download | ldetect-lst-94e692bd9c9263deaccc62c4f39244db6c67c15c.tar ldetect-lst-94e692bd9c9263deaccc62c4f39244db6c67c15c.tar.gz ldetect-lst-94e692bd9c9263deaccc62c4f39244db6c67c15c.tar.bz2 ldetect-lst-94e692bd9c9263deaccc62c4f39244db6c67c15c.tar.xz ldetect-lst-94e692bd9c9263deaccc62c4f39244db6c67c15c.zip |
add explicit alias for modules in ide/sata categories, not to use ata_generic
Diffstat (limited to 'convert')
-rwxr-xr-x | convert/uniquify-modalias.pl | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/convert/uniquify-modalias.pl b/convert/uniquify-modalias.pl index d0aa5b82..259fd160 100755 --- a/convert/uniquify-modalias.pl +++ b/convert/uniquify-modalias.pl @@ -11,7 +11,6 @@ use modalias; #- o does not match PCI class (thus ahci won't match jmicron devices) my @ignored_modules = ( - "ata_generic", #- prefer "generic" non-libata module or full implementation "intelfb", "savagefb", "tdfxfb", qr/_agp$/, qr/_rng$/, ); @@ -44,6 +43,14 @@ my @preferred_categories = ( "disk/ide", "disk/scsi", ); +#- For the following categories, the deferred modules are ignored, and +#- an explicit alias is set even if only one module match exactly. +#- This allows to workaround modules having class wildcards, which isn't supported. +my %category_deferred_modules = ( + #- prefer "generic" non-libata module or full implementation + "disk/ide" => [ "ata_generic" ], + "disk/sata" => [ "ata_generic" ], +); sub build_modalias { my ($class, $vendor, $device) = @_; @@ -79,9 +86,17 @@ sub print_module { my @aliases = group_by2(@$aliases); my @other = grep { File::FnMatch::fnmatch($_->[0], $modalias) } @$class_other; my @modules = uniq_ { $_->[1] } @aliases, @other; - @modules > 1 or return; - my @non_ignored = grep_non_matching(\@modules, \@ignored_modules); + @modules or return; + + my @category_deferred_modules; + foreach (map { list_modules::module2category($_->[1]) } @modules) { + push @category_deferred_modules, @{$category_deferred_modules{$_} || []} + } + + @modules > 1 || @category_deferred_modules or return; + + my @non_ignored = grep_non_matching(\@modules, [ @ignored_modules, @category_deferred_modules ]); if (@non_ignored == 1) { print "alias $modalias $non_ignored[0][1]\n"; return; |