[oe-commits] Darren Hart : bootimg: Fix a math thinko in the block count calculation

git at git.openembedded.org git at git.openembedded.org
Sat Apr 14 22:12:40 UTC 2012


Module: openembedded-core.git
Branch: 2011-1
Commit: 13d5e41a8ad3d8fa1935196c24f51ff5b1ecaa85
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=13d5e41a8ad3d8fa1935196c24f51ff5b1ecaa85

Author: Darren Hart <dvhart at linux.intel.com>
Date:   Wed Apr 11 10:51:12 2012 -0700

bootimg: Fix a math thinko in the block count calculation

Fixes [YOCTO #1852] ... again.

The conversion from sectors to blocks was multiplying by 2 instead
of dividing by 2. Blocks are 1024 bytes, sectors are 512 bytes. The
result was images being much larger than intended.

Reported-by: Tom Zanussi <tom.zanussi at intel.com>
(From OE-Core rev: b35384fa3ca96b31c63d764322215abced2066e4)

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
CC: Joshua Lock <josh at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/bootimg.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index c2d43c8..489819b 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -92,7 +92,8 @@ build_boot_bin() {
 	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})
+	BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+
 
 	# Ensure total sectors is an integral number of sectors per
 	# track or mcopy will complain. Sectors are 512 bytes, and we





More information about the Openembedded-commits mailing list