]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix calculation of partition number
authorEd Bartosh <ed.bartosh@linux.intel.com>
Mon, 17 Jul 2017 07:04:04 +0000 (10:04 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 21 Jul 2017 11:36:35 +0000 (12:36 +0100)
Total number of partitions should be taken into account when calculating
real partition number for msdos partition table. The number can be
different for the 4th partition: it can be 4 if there are 4 partitions in
the table and 5 if there are more than 4 partitions in the table. In the
latter case number 4 is occupied by extended partition.

[YOCTO #11790]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/plugins/imager/direct.py

index aa9cc9f4e35d1bb80986f1a7ecdf6fc9c3ef00b8..f20d8433f16493d68fab8ff48457395f3a53e78b 100644 (file)
@@ -313,7 +313,7 @@ class PartitionedImage():
                 part.realnum = 0
             else:
                 realnum += 1
-                if self.ptable_format == 'msdos' and realnum > 3:
+                if self.ptable_format == 'msdos' and realnum > 3 and len(partitions) > 4:
                     part.realnum = realnum + 1
                     continue
                 part.realnum = realnum