summaryrefslogtreecommitdiffstats
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-07 23:09:22 +0100
commit7537580b3dd21bd512fb26e56e92b6553c549fa8 (patch)
tree6bd4dd0ef8c948f7ed2273a907c48a5ec5f1aaf7
parentaa94f00eec64ef936acc80dfa826fd309daa294f (diff)
downloadopenembedded-core-contrib-7537580b3dd21bd512fb26e56e92b6553c549fa8.tar.gz
openembedded-core-contrib-7537580b3dd21bd512fb26e56e92b6553c549fa8.tar.bz2
openembedded-core-contrib-7537580b3dd21bd512fb26e56e92b6553c549fa8.zip
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] Signed-off-by: Michael Cooper <michaelcooper81@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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():
# Size of a sector used in calculations
self.sector_size = SECTOR_SIZE
self.native_sysroot = native_sysroot
+ num_real_partitions = len([p for p in self.partitions if not p.no_table])
# calculate the real partition number, accounting for partitions not
# in the partition table and logical partitions
@@ -325,7 +326,7 @@ class PartitionedImage():
part.realnum = 0
else:
realnum += 1
- if self.ptable_format == 'msdos' and realnum > 3 and len(partitions) > 4:
+ if self.ptable_format == 'msdos' and realnum > 3 and num_real_partitions > 4:
part.realnum = realnum + 1
continue
part.realnum = realnum