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
commit19ff50b42378e169c7811b558e5bebca856a77ff (patch)
treeae860b75d106e3886986b5cb61d108ec08c3e175 /mdk-stage1
parentcf6d6249f086e7218645fc94f327d38b010cd304 (diff)
downloaddrakx-19ff50b42378e169c7811b558e5bebca856a77ff.tar
drakx-19ff50b42378e169c7811b558e5bebca856a77ff.tar.gz
drakx-19ff50b42378e169c7811b558e5bebca856a77ff.tar.bz2
drakx-19ff50b42378e169c7811b558e5bebca856a77ff.tar.xz
drakx-19ff50b42378e169c7811b558e5bebca856a77ff.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;
}