Skip to content

Commit c1d0f18

Browse files
committed
main: Fix partition sizing bug
Signed-off-by: Hector Martin <[email protected]>
1 parent 8699081 commit c1d0f18

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ def action_install_into_free(self, avail_free):
247247
p_message(" You can enter a size such as '1GB', a fraction such as '50%',")
248248
p_message(" the word 'min' for the smallest allowable size, or")
249249
p_message(" the word 'max' to use all available space.")
250-
min_perc = 100 * self.osins.min_size / free_part.size
250+
min_perc = 100 * min_size / free_part.size
251251
while True:
252252
os_size = self.get_size("New OS size", default="max",
253-
min=self.osins.min_size, max=free_part.size,
253+
min=min_size, max=free_part.size,
254254
total=free_part.size)
255255
if os_size is None:
256256
continue
257257
os_size = align_down(os_size, PART_ALIGN)
258-
if os_size < self.osins.min_size:
258+
if os_size < min_size:
259259
p_error(f"Size is too small, please enter a value > {ssize(min_size)} ({min_perc:.2f}%)")
260260
continue
261261
if os_size >= free_part.size:
@@ -283,7 +283,7 @@ def action_install_into_free(self, avail_free):
283283
logging.info(f"Creating stub macOS: {label}")
284284
self.part = self.dutil.addPartition(free_part.name, "apfs", label, STUB_SIZE)
285285

286-
self.do_install(os_size)
286+
self.do_install(os_size - STUB_SIZE)
287287

288288
def do_install(self, total_size=None):
289289
p_progress(f"Installing stub macOS into {self.part.name} ({self.part.label})")

0 commit comments

Comments
 (0)