mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-12-08 23:03:46 +00:00
32 lines
1 KiB
Diff
32 lines
1 KiB
Diff
|
commit ee65af95e71018c1727825752b31ec55f608e323
|
||
|
Author: Jerome Martin <jxm@risingtidesystems.com>
|
||
|
Date: Tue Nov 1 11:39:16 2011 +0100
|
||
|
|
||
|
Added gzipped kernel fabric modules support.
|
||
|
|
||
|
* Now looks for any module name no matter what the file extension is, i.e.
|
||
|
*.ko.gz not just *.ko on the filesystem.
|
||
|
* Reported by Arch Linux user "Johannes Dewender" <arch@jonnyjd.net>
|
||
|
|
||
|
diff --git a/rtslib/utils.py b/rtslib/utils.py
|
||
|
index 17156fb..5c778f5 100644
|
||
|
--- a/rtslib/utils.py
|
||
|
+++ b/rtslib/utils.py
|
||
|
@@ -604,8 +604,14 @@ def list_available_kernel_modules():
|
||
|
'''
|
||
|
kver = os.uname()[2]
|
||
|
depfile = "/lib/modules/%s/modules.dep" % kver
|
||
|
- return [module.split(".")[0] for module in
|
||
|
- re.findall(r"[a-zA-Z0-9_-]+\.ko:", fread(depfile))]
|
||
|
+ handle = open(depfile)
|
||
|
+ try:
|
||
|
+ lines = handle.readlines()
|
||
|
+ finally:
|
||
|
+ handle.close()
|
||
|
+
|
||
|
+ return [os.path.basename(line.partition(":")[0]).partition(".")[0]
|
||
|
+ for line in lines]
|
||
|
|
||
|
def list_loaded_kernel_modules():
|
||
|
'''
|