summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-05-06 19:01:34 +0000
committerThierry Vignaud <tv@mageia.org>2011-05-06 19:01:34 +0000
commitd5017c3827cf9c0139fab1a08c781066147c54d4 (patch)
treeae860b75d106e3886986b5cb61d108ec08c3e175 /mdk-stage1
parent6234506e4227be9f9bd63d26792388fdd55217af (diff)
downloaddrakx-backup-do-not-use-d5017c3827cf9c0139fab1a08c781066147c54d4.tar
drakx-backup-do-not-use-d5017c3827cf9c0139fab1a08c781066147c54d4.tar.gz
drakx-backup-do-not-use-d5017c3827cf9c0139fab1a08c781066147c54d4.tar.bz2
drakx-backup-do-not-use-d5017c3827cf9c0139fab1a08c781066147c54d4.tar.xz
drakx-backup-do-not-use-d5017c3827cf9c0139fab1a08c781066147c54d4.zip
now that kernel replaced pcitable as data source, let's use it in order
to find out missing modules (needs new API from libpci through ldetect binded by drakxtools' c module)
Diffstat (limited to 'mdk-stage1')
-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;
}