From b35384fa3ca96b31c63d764322215abced2066e4 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Tue, 24 Jan 2012 21:20:54 -0800 Subject: 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 Signed-off-by: Darren Hart CC: Joshua Lock Signed-off-by: Richard Purdie --- meta/classes/bootimg.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta/classes') diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index df3ee7315..e65bef7cc 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -133,7 +133,7 @@ build_hddimg() { 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 -- cgit v1.2.3