[master 1/2] Fix minSize for extended partitions (#1254875)
vojtechtrefny
installerbot-noreply at redhat.com
Thu Sep 10 12:48:25 UTC 2015
From: Vojtech Trefny <vtrefny at redhat.com>
---
blivet/devices/partition.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index ed5e6c8..52f219c 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -799,7 +799,18 @@ def readCurrentSize(self):
@property
def minSize(self):
- min_size = super(PartitionDevice, self).minSize
+ if self.isExtended:
+ logicals = self.disk.format.logicalPartitions
+ if logicals:
+ end_free = Size((self.partedPartition.geometry.end - logicals[-1].geometry.end) * \
+ self.disk.format.sectorSize)
+ min_size = self.currentSize - end_free
+ else:
+ min_size = Size("1 KiB")
+
+ else:
+ min_size = super(PartitionDevice, self).minSize
+
if self.resizable and min_size:
# Adjust the min size as needed so that aligning the end sector
# won't drive the actual size below the formatting's minimum.
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/7ad545a25bd5762263523832ae1e551b3647ca9d
More information about the anaconda-patches
mailing list