summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmdk-stage1/pcmcia/merge_from_pcitable19
1 files changed, 12 insertions, 7 deletions
diff --git a/mdk-stage1/pcmcia/merge_from_pcitable b/mdk-stage1/pcmcia/merge_from_pcitable
index 16c72e8a5..bb127640c 100755
--- a/mdk-stage1/pcmcia/merge_from_pcitable
+++ b/mdk-stage1/pcmcia/merge_from_pcitable
@@ -4,6 +4,9 @@
# which is not in probe.c
use MDK::Common;
+use lib qw(/usr/lib/libDrakX);
+use run_program;
+use c;
my %probes;
foreach (cat_('probe.c')) {
@@ -14,19 +17,21 @@ foreach (cat_('probe.c')) {
}
require '/usr/bin/merge2pcitable.pl';
-my $drivers = read_pcitable("/usr/share/ldetect-lst/pcitable");
-my %pcitable = map_each {
- $::a =~ /^(....)(....)/ or die;
- "$1$2" => { vendor => $1, device => $2, driver => $::b->[0], name => $::b->[1] };
-} %$drivers;
+my %pcitable;
+my @yenta_socket_ids = grep { $_ } map {
+ /.*pci:v0000(....).*d0000(....).*/;
+ my $key = lc("$1$2");
+ $pcitable{$key} = { vendor => $1, device => $2 };
+ $key;
+ } grep { /^alias/ } run_program::get_stdout('/sbin/modinfo', 'yenta_socket');
-my @yenta_socket_ids = grep { $pcitable{$_}{driver} eq 'yenta_socket' } keys %pcitable;
if (my @missing_in_probe_c = difference2(\@yenta_socket_ids, [ keys %probes ])) {
print "Missing in `probe.c':\n",
map {
my $p = $pcitable{$_};
- qq( { 0x$p->{vendor}, 0x$p->{device}, "yenta_socket", "$p->{name}" },\n);
+ my $name = c::get_pci_description(hex($p->{vendor}), hex($p->{device}));
+ qq( { 0x$p->{vendor}, 0x$p->{device}, "yenta_socket", "$name" },\n);
} sort @missing_in_probe_c;
}