]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic/direct: reserve 2 sector for extended partition
authorChee Yang Lee <chee.yang.lee@intel.com>
Sun, 22 Mar 2020 06:57:20 +0000 (14:57 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 22 Mar 2020 10:49:23 +0000 (10:49 +0000)
extended partition should reserve at least 2 unallocated sectors
between the start of the extended partition and the start of a
logical partition.

[YOCTO #13658]

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/imager/direct.py

index c50645ff7672a4174c56e61d3f457da5fa3f02b3..2d06c242b6fec2022d0fbd4e3fb8610f225b0431 100644 (file)
@@ -403,7 +403,7 @@ class PartitionedImage():
                 # Reserve a sector for EBR for every logical partition
                 # before alignment is performed.
                 if part.type == 'logical':
-                    self.offset += 1
+                    self.offset += 2
 
             align_sectors = 0
             if part.align:
@@ -446,7 +446,7 @@ class PartitionedImage():
                         self.extendedpart = part.num
                     else:
                         self.extended_size_sec += align_sectors
-                    self.extended_size_sec += part.size_sec + 1
+                    self.extended_size_sec += part.size_sec + 2
                 else:
                     self.primary_part_num += 1
                     part.num = self.primary_part_num
@@ -512,7 +512,7 @@ class PartitionedImage():
                 # add a sector at the back, so that there is enough
                 # room for all logical partitions.
                 self._create_partition(self.path, "extended",
-                                       None, part.start - 1,
+                                       None, part.start - 2,
                                        self.extended_size_sec)
 
             if part.fstype == "swap":