[PATCH 3/3] Check for disklabels on unpartitionable devices. (#539482)

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

 



If an unpartitionable device contains a disklabel we ignore any
partitions on that device, but we want to show that the device
does contain a partition table in UI.
---
 storage/devicetree.py |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 82b7418..2c509b1 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1081,7 +1081,11 @@ class DeviceTree(object):
 
         # Check that the disk has partitions. If it does not, we must have
         # reinitialized the disklabel.
-        if not getattr(disk.format, "partitions", None):
+        #
+        # Also ignore partitions on devices we do not support partitioning
+        # of, like logical volumes.
+        if not getattr(disk.format, "partitions", None) or \
+           not disk.partitionable:
             log.debug("ignoring partition %s" % name)
             return
 
@@ -1277,6 +1281,18 @@ class DeviceTree(object):
             log.warning("aborting disklabel handler for %s" % device.name)
             return
 
+        # special handling for unsupported partitioned devices
+        if not device.partitionable:
+            try:
+                format = getFormat("disklabel",
+                                   device=device.path,
+                                   exists=True)
+            except InvalidDiskLabelError:
+                pass
+            else:
+                device.format = format
+            return
+
         # if the disk contains protected partitions we will not wipe the
         # disklabel even if clearpart --initlabel was specified
         if not self.clearPartDisks or device.name in self.clearPartDisks:
@@ -1658,11 +1674,14 @@ class DeviceTree(object):
         # Now, if the device is a disk, see if there is a usable disklabel.
         # If not, see if the user would like to create one.
         # XXX ignore disklabels on multipath or biosraid member disks
-        if device.partitionable and not \
-           (udev_device_is_biosraid(info) or
-            udev_device_is_multipath_member(info)):
+        if ((device.partitionable and not \
+             (udev_device_is_biosraid(info) or
+              udev_device_is_multipath_member(info))) or
+             not device.partitionable):
             self.handleUdevDiskLabelFormat(info, device)
-            if device.partitioned or self.isIgnored(info):
+            if device.partitioned or self.isIgnored(info) or \
+               (not device.partitionable and
+                device.format.type == "disklabel"):
                 # If the device has a disklabel, or the user chose not to
                 # create one, we are finished with this device. Otherwise
                 # it must have some non-disklabel formatting, in which case
-- 
1.6.2.5

_______________________________________________
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