[oe-commits] [openembedded-core] 01/05: wic/direct: Partition numbering is broken for MBR primary partition #4

git at git.openembedded.org git at git.openembedded.org
Thu Oct 3 21:44:48 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6a4150c7a445acb4ed8495a98727cfb1d7cc9e2c
Author: Michael Cooper <michaelcooper81 at gmail.com>
AuthorDate: Thu Oct 3 18:36:25 2019 +0300

    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 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/imager/direct.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 3ce6ad5..2441cc3 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list