summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2009-12-17 16:02:38 +0100
committerMartin Sivak <msivak@redhat.com>2010-01-08 17:13:05 +0100
commit208e125a455411388f8068d170ca276fdfb79e10 (patch)
tree0b4b2e87aef366df31bac48c346d801d542d725d /isys
parent5f8c0a3a3babb5a50f885de40522e9ebd7adcad3 (diff)
downloadanaconda-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-xisys/isys.py10
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."""