summaryrefslogtreecommitdiffstats
path: root/convert
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-11-17 14:58:46 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-11-17 14:58:46 +0000
commitde2198f85701d8c557cfd56718a486a6b07b419c (patch)
treec1e552a82405b9bfe5d4083c83ad48555643d9e1 /convert
parent857b6b4b7c21c282cb693ab436ae6c792be11340 (diff)
downloadldetect-lst-de2198f85701d8c557cfd56718a486a6b07b419c.tar
ldetect-lst-de2198f85701d8c557cfd56718a486a6b07b419c.tar.gz
ldetect-lst-de2198f85701d8c557cfd56718a486a6b07b419c.tar.bz2
ldetect-lst-de2198f85701d8c557cfd56718a486a6b07b419c.tar.xz
ldetect-lst-de2198f85701d8c557cfd56718a486a6b07b419c.zip
add support for new rh's pcitable format from FC3's hwdata
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";