Skip to contentSkip to conversation

image_types_fsl.bbclass: Use FAT 32 for images larger than 512MB

PATCH New Tzu-Jung Lee 1 participant 1 message Oct 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types_fsl.bbclass: Use FAT 32 for images larger than 512MB

Refers to the following commit of poky for more detail.

commit 722430a488f39bf583e4a557a254fb84fae4d0a7

Author: Darren Hart <[email protected]>
Date:   Wed Dec 12 14:39:15 2012 -0800

bootimg: Use FAT 32 for images larger than 512MB

Fixes [YOCTO #2138]

classes/image_types_fsl.bbclass +8 -1
index 77deb74..f323a7d 100644
@@ -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}
 
Signature · 1 line
1.9.1