summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-09-09 04:52:18 +0000
committerBill Nottingham <notting@redhat.com>2005-09-09 04:52:18 +0000
commit5c90ff7b2b9e3486413d87dea2d26ff0e187a99f (patch)
tree970d581724573564c7962475bc0397f3b1a8df06 /utils
parentec4a87597dc1d0f653b2e0574d57e55dbc727ddd (diff)
downloadanaconda-5c90ff7b2b9e3486413d87dea2d26ff0e187a99f.tar.gz
anaconda-5c90ff7b2b9e3486413d87dea2d26ff0e187a99f.tar.xz
anaconda-5c90ff7b2b9e3486413d87dea2d26ff0e187a99f.zip
* anaconda.spec: Bump version, tweak requirements
* installclass.py (setVideoCard, configureX): Adapt to new rhpl X setup code * kickstart.py (doXConfig): Likewise * kickstartData.py (__init__): Likewise * kickstartParser.py (doXConfig): Likewise * packages.py (writeXConfiguration): Likewise * xsetup.py (getArgList): Likewise * scripts/mk-images: Remove modules.pcimap, modules.usbmap, pcitable, from images, and associated trimmer scripts from files used. Add modules.alias, videoaliases. Trim modules.alias using trimmodalias. * scripts/upd-instroot: Don't keep Cards, but keep videoaliases. Don't run checkcards.py * utils/trimmodalias: New script, trim modules.alias file to match modules in the first/second stage * utils/trimpciids: Trim pci.ids based on modules.alias and videoaliases, not pcitable and modules.pcimap * utils/checkcards.py: Remove now obsolete script * utils/trimmodmap: Likewise * utils/trimpcitable: Likewise * utils/trimusbmap: Likewise
Diffstat (limited to 'utils')
-rwxr-xr-xutils/checkcards.py66
-rwxr-xr-xutils/trimmodalias23
-rw-r--r--utils/trimmodmap43
-rwxr-xr-xutils/trimpciids29
-rwxr-xr-xutils/trimpcitable21
-rwxr-xr-xutils/trimusbmap16
6 files changed, 38 insertions, 160 deletions
diff --git a/utils/checkcards.py b/utils/checkcards.py
deleted file mode 100755
index 6ac81755b..000000000
--- a/utils/checkcards.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-import sys
-import string
-
-def usage():
- print "Usage: checkcards.py [pcitable] [Cards]"
-
-if len(sys.argv) < 2:
- usage ()
- sys.exit (1)
-
-pcifile = sys.argv[1]
-cardsfile = sys.argv[2]
-
-def getcards (cardsfile):
- cards = {}
- db = open (cardsfile)
- lines = db.readlines ()
- db.close ()
- card = {}
- name = None
- for line in lines:
- line = string.strip (line)
- if not line and name:
- cards[name] = card
- card = {}
- name = None
- continue
-
- if line and line[0] == '#':
- continue
-
- if len (line) > 4 and line[0:4] == 'NAME':
- name = line[5:]
-
- info = string.splitfields (line, ' ')
- if card.has_key (info[0]):
- card[info[0]] = card[info[0]] + '\n' + (string.joinfields (info[1:], ' '))
- else:
- card[info[0]] = string.joinfields (info[1:], ' ')
-
- return cards
-
-pcitable = open (pcifile, 'r')
-lines = pcitable.readlines()
-cards = []
-for line in lines:
- if line[0] == '#':
- continue
- fields = string.split(line, '\t')
- if len (fields) < 4:
- continue
- card = fields[2]
- if card[1:6] == "Card:":
- cards.append (card[6:-1])
-
-carddb = getcards (cardsfile)
-
-rc = 0
-for card in cards:
- if not carddb.has_key(card):
- print "*** pcitable error *** Card not found:", card
- rc = 1
-
-sys.exit(rc)
-
diff --git a/utils/trimmodalias b/utils/trimmodalias
new file mode 100755
index 000000000..f8dad21f0
--- /dev/null
+++ b/utils/trimmodalias
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import os
+import sys
+import string
+
+modules = []
+
+args = sys.argv[1:]
+
+for arg in args:
+ arg = os.path.basename(arg)
+ arg = arg.replace('.ko','')
+ modules.append(arg)
+
+f = sys.stdin.readline()
+
+while f:
+ f = f.strip()
+ for mod in modules:
+ if f.endswith(' %s' % (mod,)):
+ print f
+ f = sys.stdin.readline()
diff --git a/utils/trimmodmap b/utils/trimmodmap
deleted file mode 100644
index 0d87114c8..000000000
--- a/utils/trimmodmap
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl
-
-open (F, $ARGV[0]);
-@ents = (<F>);
-close (F);
-
-shift @ARGV;
-
-foreach $n (@ARGV) {
- $n =~ s/\.ko$//;
- $mods{"$n"} = $n;
-}
-
-
-while (<STDIN>) {
- chop;
- $line = $_;
- s/0x0000/0x/g;
- @a = split;
- if ($mods{$a[0]}) {
- if ($a[1] ne "0xffffffff" && $a[2] ne "0xffffffff") {
- if ($a[3] eq "0xffffffff" && $a[4] eq "0xffffffff") {
- @res = grep (/^$a[1]\t$a[2]\t"$a[0]"/, @ents);
- if (length(@res) != 0 && ! $res[0]) {
- print $line."\n";
- }
- } else {
- @res = grep (/^$a[1]\t$a[2]\t"$a[0]"/, @ents);
- if ($res[0]) {
- @b = split "\t",$res[0];
- if ($b[2] ne "\"$a[0]\"") {
- print $line."\n";
- }
- } else {
- @res = grep (/^$a[1]\t$a[2]\t$a[3]\t$a[4]\t"$a[0]"/, @ents);
- if (!$res[0]) {
- print $line."\n";
- }
- }
- }
- }
- }
-}
diff --git a/utils/trimpciids b/utils/trimpciids
index 3274dc2cf..2d177acc7 100755
--- a/utils/trimpciids
+++ b/utils/trimpciids
@@ -12,27 +12,28 @@ if f:
pcitable = f.readlines()
f.close()
for line in pcitable:
- if not line.startswith("0x"):
+ if not line.startswith("alias pci:"):
continue
- fields = line.split('\t')
- if fields[0] not in vendors:
- vendors.append(fields[0])
- if (fields[0], fields[1]) not in devices:
- devices.append( (fields[0],fields[1]))
+ vend = "0x%s" % (line[15:19],)
+ dev = "0x%s" % (line[24:28],)
+ if vend not in vendors:
+ vendors.append(vend)
+ if (vend, dev) not in devices:
+ devices.append( (vend, dev) )
+
f = open(sys.argv[2])
if f:
- pcimap = f.readlines()
+ pcitable = f.readlines()
f.close()
- for line in pcimap:
- if line.startswith("#"):
+ for line in pcitable:
+ if not line.startswith("alias pcivideo:"):
continue
- ( trash, vend, dev, trash, trash, trash , trash, trash ) = line.split()
- vend = vend.replace("0x0000","0x",1)
- dev = dev.replace("0x0000","0x",1)
+ vend = "0x%s" % (line[20:24],)
+ dev = "0x%s" % (line[29:33],)
if vend not in vendors:
vendors.append(vend)
- if (vend,dev) not in devices:
- devices.append( (vend, dev))
+ if (vend, dev) not in devices:
+ devices.append( (vend, dev) )
pciids = sys.stdin.readlines()
current_vend = 0
diff --git a/utils/trimpcitable b/utils/trimpcitable
deleted file mode 100755
index c2cbe425e..000000000
--- a/utils/trimpcitable
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/perl
-
-foreach $n (@ARGV) {
- $n =~ s/\.ko$//;
- $mods{"\"$n\""} = $n;
-}
-
-while (<STDIN>) {
- chop;
- @a = split;
- if ($mods{$a[2]} || $mods{$a[4]}) {
- print "$_\n";
- } elsif ($_ =~ /Card:Intel.*81[05]/) {
- print "$_\n";
- } elsif ($a[4] =~ /\"ignore\"/) {
- print "$_\n";
- } elsif ($a[4] =~ /\"unknown\"/) {
- print "$_\n";
- }
-
-}
diff --git a/utils/trimusbmap b/utils/trimusbmap
deleted file mode 100755
index ece40a705..000000000
--- a/utils/trimusbmap
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/perl
-
-foreach $n (@ARGV) {
- $n =~ s/\.ko$//;
- $mods{"$n"} = $n;
-}
-
-
-while (<STDIN>) {
- chop;
- $line = $_;
- @a = split;
- if ($mods{$a[0]}) {
- print $line."\n";
- }
-}