]> code.ossystems Code Review - openembedded-core.git/commitdiff
bootimg: Fix a math thinko in the block count calculation
authorDarren Hart <dvhart@linux.intel.com>
Wed, 25 Jan 2012 05:20:54 +0000 (21:20 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 25 Jan 2012 14:29:45 +0000 (14:29 +0000)
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@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/bootimg.bbclass

index df3ee7315ad32097100634ae655a31ee2c82807f..e65bef7ccadbc9611f4be36082b06f865081421f 100644 (file)
@@ -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