summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/imager/direct.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-08-21 14:46:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-22 15:46:55 +0100
commit5fa3c3d2e3aa29f4011670d6032e4f7debc88f73 (patch)
treecf22e082011738865dce0e0e4343aff2a5890afe /scripts/lib/wic/plugins/imager/direct.py
parent5359b85610f8a3e0a42d4817bb7df71436ab1192 (diff)
downloadpoky-5fa3c3d2e3aa29f4011670d6032e4f7debc88f73.tar.gz
wic: Add 512 Byte alignment to --offset
Allows the --offset argument to use the "s" or "S" suffix to specify that it is reporting the number of 512 byte sectors. This is required for some SoCs where the mask ROM looks for an item at a sector that isn't aligned to a 1KB boundary. (From OE-Core rev: 938595d1dc4abaf5f7f3a7900add3f0492b805d0) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/imager/direct.py')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 2f01999405..55db826e93 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -429,14 +429,14 @@ class PartitionedImage():
429 self.offset += align_sectors 429 self.offset += align_sectors
430 430
431 if part.offset is not None: 431 if part.offset is not None:
432 offset = (part.offset * 1024) // self.sector_size 432 offset = part.offset // self.sector_size
433 433
434 if offset * self.sector_size != part.offset * 1024: 434 if offset * self.sector_size != part.offset:
435 raise WicError("Could not place %s%s at offset %dK with sector size %d" % (part.disk, self.numpart, part.offset, self.sector_size)) 435 raise WicError("Could not place %s%s at offset %d with sector size %d" % (part.disk, self.numpart, part.offset, self.sector_size))
436 436
437 delta = offset - self.offset 437 delta = offset - self.offset
438 if delta < 0: 438 if delta < 0:
439 raise WicError("Could not place %s%s at offset %dK: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, self.offset, delta)) 439 raise WicError("Could not place %s%s at offset %d: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, self.offset, delta))
440 440
441 logger.debug("Skipping %d sectors to place %s%s at offset %dK", 441 logger.debug("Skipping %d sectors to place %s%s at offset %dK",
442 delta, part.disk, self.numpart, part.offset) 442 delta, part.disk, self.numpart, part.offset)