[PATCH 2/4] Prevent /sys/class/block/mapper!vg*-lv* lookups.

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

 



I was hitting this today.  The /dev/mapper/vg*-lv* names were getting
translated to /sys/class/block/mapper!vg*-lv*.
---
 pyanaconda/iutil.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index a004ae0..00567d7 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -806,9 +806,7 @@ def get_sysfs_path_by_name(dev_node, class_name="block"):
         (e.g. /sys/class/block/vda2). This also has to work for device nodes
         that are in a subdirectory of /dev like '/dev/cciss/c0d0p1'.
      """
-    dev_name = os.path.basename(dev_node)
-    if dev_node.startswith("/dev/"):
-        dev_name = dev_node[5:].replace("/", "!")
+    dev_name = os.path.basename(os.path.realpath(dev_node)).replace("/", "!")
     sysfs_class_dir = "/sys/class/%s" % class_name
     dev_path = os.path.join(sysfs_class_dir, dev_name)
     if os.path.exists(dev_path):
-- 
1.7.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