diff options
author | Bill Nottingham <notting@redhat.com> | 2007-08-03 16:07:41 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2007-08-03 16:07:41 +0000 |
commit | 9f03ae022c29ba8964bc53d9a69993ed2b43f40c (patch) | |
tree | 64555efc4dc75de92aa9a897e866917b1c4d7021 /utils | |
parent | f8650855f6de5f5a50ed8975e23404475087bfa3 (diff) | |
download | anaconda-9f03ae022c29ba8964bc53d9a69993ed2b43f40c.tar.gz anaconda-9f03ae022c29ba8964bc53d9a69993ed2b43f40c.tar.xz anaconda-9f03ae022c29ba8964bc53d9a69993ed2b43f40c.zip |
* utils/genmodinfo: New file, utility to generate module-info on the fly
* utils/Makefile: Install genmodinfo.
* scripts/mk-images: Use genmodinfo.
* loader2/module-info, loader2/Makefile: Kill it dead.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile | 1 | ||||
-rwxr-xr-x | utils/genmodinfo | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/utils/Makefile b/utils/Makefile index 641c9dc3c..143c14ef7 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -57,6 +57,7 @@ depends: install: all mkdir -p $(DESTDIR)/usr/bin mkdir -p $(DESTDIR)/$(RUNTIMEDIR) + install -m755 genmodinfo $(DESTDIR)/$(RUNTIMEDIR) install -m755 trimmodalias $(DESTDIR)/$(RUNTIMEDIR) install -m755 trimpciids $(DESTDIR)/$(RUNTIMEDIR) install -m755 moddeps $(DESTDIR)/$(RUNTIMEDIR) diff --git a/utils/genmodinfo b/utils/genmodinfo new file mode 100755 index 000000000..6b7310479 --- /dev/null +++ b/utils/genmodinfo @@ -0,0 +1,54 @@ +#!/usr/bin/python + +import commands +import os +import string +import sys + +uname = os.uname()[2] + +if len(sys.argv) > 1: + path = sys.argv[1] +else: + path = '/lib/modules/%s' % (uname,) + +mods = {} +for root, dirs, files in os.walk(path): + for file in files: + mods[file] = os.path.join(root,file) + +modules = { 'scsi_hostadapter' : [ 'block' ], 'eth' : [ 'networking'] } + +list = {} + +for modtype in modules.keys(): + list[modtype] = {} + for file in modules[modtype]: + try: + f = open('%s/modules.%s' % (path,file),'r') + except: + continue + lines = f.readlines() + f.close() + for line in lines: + line = line.strip() + if mods.has_key(line): + desc = commands.getoutput("modinfo -F description %s" % (mods[line])) + modname = line[:-3] + if desc and len(desc) > 65: + desc = desc[:65] + if not desc: + desc = "%s driver" % (modname,) + modinfo = """ +%s + %s + "%s" +""" % (modname, modtype, desc) + list[modtype][modname] = modinfo + +print "Version 0" +for type in list.keys(): + modlist = list[type].keys() + modlist.sort() + for m in modlist: + print list[type][m] |