Fixes [YOCTO #1940]

do_bootimg was performing the FAT overhead calculations assuming FAT32 and then
forcing the use of FAT32 with "-F 32" to mkdosfs. The FAT specification is clear
on cluster count being the determining factor for FAT size (even if the fs
string is set to FAT32, go figure). Syslinux follows this spec, and rightly so,
resulting in a failure on core-image-minimal:

        syslinux: zero FAT sectors (FAT12/16)

Drop the "-F 32" from mkdosfs to allow it to select the appropriate FAT size
based on cluster count. Leave the FAT overhead calculation in FAT32. This will
result in a little extra padding for really small images, but not enough extra
to justify recalculating for FAT12 and FAT16.

Tested with a core-image-minimal build for atom-pc. do_bootimg completed
successfully, and the resulting image was FAT16.

(From OE-Core rev: 634137704dd1a205e377a1131ef708f1c981f6b2)

Signed-off-by: Darren Hart <dvh...@linux.intel.com>
Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvh...@linux.intel.com>
---
 meta/classes/bootimg.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 489819b..09f5b67 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -73,6 +73,9 @@ build_boot_bin() {
        # Account for the filesystem overhead. This includes directory
        # entries in the clusters as well as the FAT itself.
        # Assumptions:
+       #   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
+       #   padding will be minimal on those smaller images and not
+       #   worth the logic here to caclulate the smaller FAT sizes)
        #   < 16 entries per directory
        #   8.3 filenames only
 
@@ -102,7 +105,7 @@ build_boot_bin() {
        BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
 
        IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-       mkdosfs -F 32 -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
+       mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
        # Copy HDDDIR recursively into the image file directly
        mcopy -i ${IMG} -s ${HDDDIR}/* ::/
 
-- 
1.7.5.4

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to