From de2198f85701d8c557cfd56718a486a6b07b419c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 17 Nov 2004 14:58:46 +0000 Subject: add support for new rh's pcitable format from FC3's hwdata --- convert/README.pcitable | 2 ++ convert/merge2pcitable.pl | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'convert') diff --git a/convert/README.pcitable b/convert/README.pcitable index ce6cce4a..97a8c3cf 100644 --- a/convert/README.pcitable +++ b/convert/README.pcitable @@ -26,6 +26,8 @@ rm -f pcids.htm ; wget http://www.begent.co.uk/pcids.htm # with redhat's pcitable in /tmp/rh_pcitable (from kudzu or anaconda) ./merge2pcitable.pl pcitable /tmp/rh_pcitable pcitable > pcitable.new +# with redhat's pcitable in /tmp/rh_pcitable (from hwdata) +./merge2pcitable.pl rhpcitable /tmp/rh_pcitable pcitable > pcitable.new # with a new kernel (cd ~/tmp ; rm -rf lib ; rpm2cpio /RPMS/kernel-2.4.*.rpm |cpio -id './lib/modules/*/modules.*map') diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl index a7f7588d..ed304d72 100755 --- a/convert/merge2pcitable.pl +++ b/convert/merge2pcitable.pl @@ -44,10 +44,15 @@ sub to_string { join "\t", $id1, $id2, if_("$subid1 $subid2" ne "0xffff 0xffff", $subid1, $subid2), $module, $text; } +sub read_rhpcitable { + my ($f, $strict) = @_; + read_pcitable($f, $strict, 1); +} + # works for RedHat's pcitable old and new format, + mdk format (alike RedHat's old one) # (the new format has ending .o's and double quotes are removed) sub read_pcitable { - my ($f, $strict) = @_; + my ($f, $strict, $newer_rh_format) = @_; my %drivers; my %class; my $line = 0; @@ -69,6 +74,7 @@ sub read_pcitable { } if (my ($id1, $id2, @l) = split /\t+/) { + push @l, '""' if $newer_rh_format; my ($subid1, $subid2) = ('ffff', 'ffff'); ($subid1, $subid2, @l) = @l if @l == 4; @l == 2 or die "$f:$line: bad number of fields " . (int @l) . " (in $_)\n"; -- cgit v1.2.1