[PATCH 1/3] Extend udev_resolve_devspec to allow specifying devices in more ways.

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

 



This allows specifying by anything that could be in DEVLINKS, which includes
stuff like UUID a second way, physical device path on the system, serial
number, and perhaps other methods depending on what kinds of devices are
installed.  The next step is making this work throughout kickstart.
---
 storage/udev.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index 9d0abd7..a29ddba 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -44,10 +44,14 @@ def udev_resolve_devspec(devspec):
             if udev_device_get_uuid(dev) == devspec[5:]:
                 ret = dev
                 break
+        elif udev_device_get_name(dev) == _devices.devicePathToName(devspec):
+            ret = dev
+            break
         else:
-            if udev_device_get_name(dev) == _devices.devicePathToName(devspec):
-                ret = dev
-                break
+            for link in dev["symlinks"]:
+                if devspec == "/dev/" + link:
+                    ret = dev
+                    break
 
     del _devices
     if ret:
-- 
1.6.5.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