Skip to contentSkip to conversation

wic/direct: reserve 2 sector for extended partition

PATCH New Lee Chee Yang 1 participant 1 message Mar 22, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic/direct: reserve 2 sector for extended partition

From: Chee Yang Lee <[email protected]>

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]

---
 scripts/lib/wic/plugins/imager/direct.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/lib/wic/plugins/imager/direct.py +3 -3
index c50645f..2d06c24 100644
@@ -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":
Signature · 1 line
2.7.4