summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 3ce6ad55b8..2441cc33ad 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -316,6 +316,7 @@ class PartitionedImage():
316 # Size of a sector used in calculations 316 # Size of a sector used in calculations
317 self.sector_size = SECTOR_SIZE 317 self.sector_size = SECTOR_SIZE
318 self.native_sysroot = native_sysroot 318 self.native_sysroot = native_sysroot
319 num_real_partitions = len([p for p in self.partitions if not p.no_table])
319 320
320 # calculate the real partition number, accounting for partitions not 321 # calculate the real partition number, accounting for partitions not
321 # in the partition table and logical partitions 322 # in the partition table and logical partitions
@@ -325,7 +326,7 @@ class PartitionedImage():
325 part.realnum = 0 326 part.realnum = 0
326 else: 327 else:
327 realnum += 1 328 realnum += 1
328 if self.ptable_format == 'msdos' and realnum > 3 and len(partitions) > 4: 329 if self.ptable_format == 'msdos' and realnum > 3 and num_real_partitions > 4:
329 part.realnum = realnum + 1 330 part.realnum = realnum + 1
330 continue 331 continue
331 part.realnum = realnum 332 part.realnum = realnum