[PATCH 4/7] Include the livecd OS image devices in the device tree.

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

 



---
 pyanaconda/storage/devicetree.py |    9 ++++++++-
 pyanaconda/storage/udev.py       |   10 ++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 8353f1e..af1ce33 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -654,7 +654,6 @@ class DeviceTree(object):
                             return
 
                 if cleanup_luks:
-                    slave_dev = slave_dev
                     slave_info = new_info
 
             # try to get the device again now that we've got all the slaves
@@ -674,6 +673,14 @@ class DeviceTree(object):
                 # try once more to get the device
                 device = self.getDeviceByName(name)
 
+            # create a device for the livecd OS image(s)
+            if device is None and udev_device_is_dm_livecd(info):
+                device = DMDevice(name, dmUuid=info.get('DM_UUID'),
+                                  sysfsPath=sysfs_path, exists=True,
+                                  parents=[slave_dev])
+                device.protected = True
+                self._addDevice(device)
+
             # if we get here, we found all of the slave devices and
             # something must be wrong -- if all of the slaves are in
             # the tree, this device should be as well
diff --git a/pyanaconda/storage/udev.py b/pyanaconda/storage/udev.py
index ce366ed..df6d99e 100644
--- a/pyanaconda/storage/udev.py
+++ b/pyanaconda/storage/udev.py
@@ -434,12 +434,18 @@ def udev_device_is_dm_mpath(info):
     return udev_device_dm_subsystem_match(info, "mpath")
 
 def udev_device_is_dm_anaconda(info):
-    """ Return True is the device is an anaconda disk image. """
+    """ Return True if the device is an anaconda disk image. """
     return udev_device_dm_subsystem_match(info, "anaconda")
 
+def udev_device_is_dm_livecd(info):
+    """ Return True if the device is a livecd OS image. """
+    # return udev_device_dm_subsystem_match(info, "livecd")
+    return (udev_device_is_dm(info) and
+            udev_device_get_name(info).startswith("live"))
+
 def udev_device_is_biosraid_member(info):
     # Note that this function does *not* identify raid sets.
-    # Tests to see if device is parto of a dmraid set.
+    # Tests to see if device is part of a dmraid set.
     # dmraid and mdraid have the same ID_FS_USAGE string, ID_FS_TYPE has a
     # string that describes the type of dmraid (isw_raid_member...),  I don't
     # want to maintain a list and mdraid's ID_FS_TYPE='linux_raid_member', so
-- 
1.7.3.3

_______________________________________________
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