[PATCH 1/1] Treat the loop labels as devices without a label.(#493219)

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

 



The label "loop" in parted means devices that have no partition table but
have a filesystem.  Since anaconda does not handle this state, we shall
handle said devices as if they had no label.
---
 storage/devices.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index c6fbdcc..67b8055 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -709,6 +709,16 @@ class DiskDevice(StorageDevice):
                     else:
                         raise DeviceUserDeniedFormatError("User prefered to not format.")
 
+                # When the device has no partition table but it has a FS, it
+                # will be created with label type loop.  Treat the same as if
+                # the device had no label (cause it really doesn't).
+                if self.partedDisk.type == "loop":
+                    if initcb is not None and initcb():
+                        self.partedDisk = parted.freshDisk(device=self.partedDevice, \
+                                ty = platform.getPlatform(None).diskType)
+                    else:
+                        raise DeviceUserDeniedFormatError("User prefered to not format.")
+
         # We save the actual state of the disk here. Before the first
         # modification (addPartition or removePartition) to the partition
         # table we reset self.partedPartition to this state so we can
-- 
1.6.0.6

_______________________________________________
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