]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: do not steal sectors from the first partition
authorMaciej Borzecki <maciej.borzecki@open-rnd.pl>
Tue, 19 Aug 2014 13:14:17 +0000 (15:14 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Aug 2014 08:25:04 +0000 (09:25 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/utils/partitionedfs.py

index 76aa42135bdbbac6d126356c376fe1dd52ebc13e..36ef4063d12f56854b19863d68ce78120248e218 100644 (file)
@@ -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