summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorMichael Cooper <michaelcooper81@gmail.com>2019-10-03 18:36:25 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-08 11:22:24 +0100
commit7a1d68d136c9746242d2243c7e9959758437a3fa (patch)
tree4e351e93d53b13ca008d5677a7924b96d6213410 /scripts/lib/wic
parent41d225f4a37d02e9f79bdbfb79caac8cd3d291ce (diff)
downloadpoky-7a1d68d136c9746242d2243c7e9959758437a3fa.tar.gz
wic/direct: Partition numbering is broken for MBR primary partition #4
When wks describes extra partitions that aren't in the partition table (e.g. boot loader) and exactly four primary MBR partitions, the last partition gets added to fstab as partition #5 instead of #4. [YOCTO #13560] (From OE-Core rev: 7537580b3dd21bd512fb26e56e92b6553c549fa8) Signed-off-by: Michael Cooper <michaelcooper81@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-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