bootimg: Fix a math thinko in the block count calculation
cover bootimg: Fix a math thinko in the block count calculation
The following changes since commit 6b2cb8280211d2e28ce75d6a107f99a3fa7868ae:
gcc-common.inc: Fix comment (2012-01-24 14:38:39 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dvhart/bug/1852
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/bug/1852
Darren Hart (1):
bootimg: Fix a math thinko in the block count calculation
meta/classes/bootimg.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.6.5
PATCH 1/1 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.
--- meta/classes/bootimg.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
meta/classes/bootimg.bbclass +1 -1
@@ -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
Signature · 1 line
1.7.6.5
Quoted 6 lines · Darren Hart
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.
Much better, thanks for the quick fix.
Quoted 20 lines
Reported-by Tom Zanussi <[email protected]>Signed-off-by Darren Hart <[email protected]>CC Joshua Lock <[email protected]>--- meta/classes/bootimg.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)meta/classes/bootimg.bbclass +1
-1@@ -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
Richard Purdie
AppliedQuoted 6 lines · Darren Hart
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.
Quoted 6 lines
Reported-by Tom Zanussi <[email protected]>Signed-off-by Darren Hart <[email protected]>CC Joshua Lock <[email protected]>--- meta/classes/bootimg.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Merged to master, thanks.
Richard