[PATCH 2/2] Check for presence of filesystem module in FS.mountable (#580520)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FS.mountable was returning False in cases where the filesystem module
was not yet loaded in the kernel (so not present in /proc/filesystems)
and lacking a special /sbin/mount program for the filesystem.

Add an additional check to scan the kernel modules directory for a
filesystem driver with the filename starting with
    "%s.ko" % self.mountType
---
 storage/formats/fs.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index ef8e71f..2cf7bd7 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -736,8 +736,18 @@ class FS(DeviceFormat):
 
     @property
     def mountable(self):
-        return (self.mountType in kernel_filesystems) or \
-               (os.access("/sbin/mount.%s" % (self.mountType,), os.X_OK))
+        canmount = (self.mountType in kernel_filesystems) or \
+                   (os.access("/sbin/mount.%s" % (self.mountType,), os.X_OK))
+        modpath = os.path.realpath(os.path.join("/lib/modules", os.uname()[2]))
+        modname = "%s.ko" % self.mountType
+
+        if not canmount and os.path.isdir(modpath):
+            for root, dirs, files in os.walk(modpath):
+                have = filter(lambda x: x.startswith(modname), files)
+                if len(have) == 1 and have[0].startswith(modname):
+                    return True
+
+        return canmount
 
     @property
     def resizable(self):
-- 
1.6.6.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux