]> code.ossystems Code Review - meta-freescale.git/commitdiff
image_types_fsl.bbclass: Use FAT 32 for images larger than 512MB
authorTzu-Jung Lee <roylee17@gmail.com>
Fri, 16 Oct 2015 18:12:00 +0000 (18:12 +0000)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 19 Apr 2016 18:03:21 +0000 (15:03 -0300)
Refers to the following commit of poky for more detail.

commit 722430a488f39bf583e4a557a254fb84fae4d0a7
Author: Darren Hart <dvhart@linux.intel.com>
Date:   Wed Dec 12 14:39:15 2012 -0800

    bootimg: Use FAT 32 for images larger than 512MB

        Fixes [YOCTO #2138]

Signed-off-by: Tzu-Jung Lee <roylee17@currantlabs.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
classes/image_types_fsl.bbclass

index 77deb742fca3180fe412e4f06b4a989711e93aa6..f323a7d7aa5a011b04532d773f2b561ff6b79f49 100644 (file)
@@ -103,8 +103,15 @@ _generate_boot_image() {
        BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDCARD} unit b print \
                          | awk "/ $boot_part / { print substr(\$4, 1, length(\$4 -1)) / 1024 }")
 
+       # mkdosfs will sometimes use FAT16 when it is not appropriate,
+       # resulting in a boot failure from SYSLINUX. Use FAT32 for
+       # images larger than 512MB, otherwise let mkdosfs decide.
+       if [ $(expr $BOOT_BLOCKS / 1024) -gt 512 ]; then
+               FATSIZE="-F 32"
+       fi
+
        rm -f ${WORKDIR}/boot.img
-       mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -F 32 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
+       mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 ${FATSIZE} -C ${WORKDIR}/boot.img $BOOT_BLOCKS
 
        mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::/${KERNEL_IMAGETYPE}