summaryrefslogtreecommitdiffstats
path: root/convert
diff options
context:
space:
mode:
Diffstat (limited to 'convert')
-rw-r--r--convert/README.pcitable2
-rwxr-xr-xconvert/merge2pcitable.pl8
2 files changed, 9 insertions, 1 deletions
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";