[oe-commits] [openembedded-core] 51/56: image-live.bbclass: Tweak rounding up sector count
git at git.openembedded.org
git at git.openembedded.org
Mon May 30 08:39:14 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 01828c22f6e621be73dcda913b3c1b6aeddc70b5
Author: Jussi Kukkonen <jussi.kukkonen at intel.com>
AuthorDate: Fri May 27 11:08:46 2016 +0300
image-live.bbclass: Tweak rounding up sector count
New mkdosfs has changed the default sectors-per-track it sets on a
new image: This number is useless in our use case but mcopy has
sanity checks to make sure image size is an integral number of
sectors-per-track.
Make sure our sector count is always divisible by sectors-per-track.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta/classes/image-live.bbclass | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
index ea6ced2..9b65753 100644
--- a/meta/classes/image-live.bbclass
+++ b/meta/classes/image-live.bbclass
@@ -199,14 +199,15 @@ build_fat_img() {
FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
- # Determine the final size in blocks accounting for some padding
- BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+ # Determine the final size accounting for some padding
+ SECTORS=$(expr $SECTORS + $(expr ${BOOTIMG_EXTRA_SPACE} \* 2))
# Ensure total sectors is an integral number of sectors per
- # track or mcopy will complain. Sectors are 512 bytes, and we
- # generate images with 32 sectors per track. This calculation is
- # done in blocks, thus the mod by 16 instead of 32.
- BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+ # track or mcopy will complain. Sectors are 512 bytes, and current
+ # mkdosfs generates images with 63 sectors per track. Use 2*63
+ # as the mod to ensure result is divisible by two.
+ SECTORS=$(expr $SECTORS + $(expr 126 - $(expr $SECTORS % 126)))
+ BLOCKS=$(expr $SECTORS / 2)
# mkdosfs will sometimes use FAT16 when it is not appropriate,
# resulting in a boot failure from SYSLINUX. Use FAT32 for
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list