Patchwork [1/2] wic: do not steal sectors from the first partition

login
register
mail settings
Submitter Maciej Borzecki
Date Aug. 19, 2014, 1:14 p.m.
Message ID <1408454058-2192-2-git-send-email-maciej.borzecki@open-rnd.pl>
Download mbox | patch
Permalink /patch/78611/
State Accepted
Commit 5686b2d5a7a9ebefb4f427aa32578581068ce2c7
Headers show

Comments

Maciej Borzecki - Aug. 19, 2014, 1:14 p.m.
In order to make up for space loss due to overhead located before the
first partition, same amount of bytes was extracted from the first
partition's size. This leads to unexpected change of first partition's
size, and is not matched by similar adjustment at the time the partition
image is generated. Thus it is possible that the first partition may
partially overwrite contents of the following partition, as the
partition image is larger than the allocated space.

This is also problematic on certain platforms such as OMAP, where the
first partition is required for have an even number of
sectors (typically already expressed by --size in kickstart
file). Subtracting an odd number of sectors lost for overhead, leads to
an odd number of sectors assigned for partition, preventing the board,
such as beaglebone, from booting correctly.

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
---
 scripts/lib/wic/utils/partitionedfs.py | 3 ---
 1 file changed, 3 deletions(-)

Patch

diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 76aa421..36ef406 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -155,9 +155,6 @@  class Image:
 
                 # Skip one sector required for the partitioning scheme overhead
                 d['offset'] += overhead
-                # Steal few sectors from the first partition to offset for the
-                # partitioning overhead
-                p['size'] -= overhead
 
             if p['align']:
                 # If not first partition and we do have alignment set we need