diff options
author | Martin Sivak <msivak@redhat.com> | 2009-12-17 16:02:38 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2010-01-08 17:13:05 +0100 |
commit | 208e125a455411388f8068d170ca276fdfb79e10 (patch) | |
tree | 0b4b2e87aef366df31bac48c346d801d542d725d /isys | |
parent | 5f8c0a3a3babb5a50f885de40522e9ebd7adcad3 (diff) | |
download | anaconda-208e125a455411388f8068d170ca276fdfb79e10.tar.gz anaconda-208e125a455411388f8068d170ca276fdfb79e10.tar.xz anaconda-208e125a455411388f8068d170ca276fdfb79e10.zip |
Add a function to get paths to loaded modules
Diffstat (limited to 'isys')
-rwxr-xr-x | isys/isys.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/isys/isys.py b/isys/isys.py index 449adedb8..4fd0b93d4 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -390,6 +390,16 @@ def ext2HasJournal(device): hasjournal = _isys.e2hasjournal(device); return hasjournal +def modulesWithPaths(): + mods = [] + for modline in open("/proc/modules", "r"): + modName = modline.split(" ", 1)[0] + modInfo = iutil.execWithCapture("modinfo", + ["-F", "filename", modName]).splitlines() + modPaths = [ line.strip() for line in modInfo if line!="" ] + mods.extend(modPaths) + return mods + def driveUsesModule(device, modules): """Returns true if a drive is using a prticular module. Only works for SCSI devices right now.""" |