From 5210d62a012cc1e8e881732a863578d385175f67 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 11 Jul 2001 03:02:35 +0000 Subject: not all partition tables are limited to only 4 primary partitions... --- autopart.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'autopart.py') diff --git a/autopart.py b/autopart.py index d6f2f894d..76f31ca89 100644 --- a/autopart.py +++ b/autopart.py @@ -86,12 +86,13 @@ def findFreespace(diskset): def bestPartType(disk, request): numPrimary = len(get_primary_partitions(disk)) - if numPrimary == 4: + maxPrimary = disk.max_primary_partition_count + if numPrimary == maxPrimary: # raise an error? return PARTITION_FAIL if request.primary: return parted.PARTITION_PRIMARY - if numPrimary == 3 and not disk.extended_partition: + if (numPrimary == (maxPrimary - 1)) and not disk.extended_partition: return parted.PARTITION_EXTENDED return parted.PARTITION_PRIMARY -- cgit