Hello,
Looking thru notes from the last meeting, I see that Bill noted a need to manually resize a Xilinx SD card image after the build as "pain point". I looked into it, and found a workaround on how to build an image of proper size right away:
--- a/meta-xilinx-bsp/classes/image-types-xilinx-qemu.bbclass +++ b/meta-xilinx-bsp/classes/image-types-xilinx-qemu.bbclass @@ -6,5 +6,5 @@ # 512K).
CONVERSIONTYPES_append = " qemu-sd" -CONVERSION_CMD_qemu-sd = "cp ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd; truncate -s %512K ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd" +CONVERSION_CMD_qemu-sd = "cp ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd; truncate -s %256M ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd" CONVERSION_DEPENDS_qemu-sd = "coreutils-native"
Interesting, that comment on that file says:
# Define the 'qemu-sd' conversion type # # This conversion type pads any image to the 512K boundary to ensure that the # image file can be used directly with QEMU's SD emulation which requires the # block device to match that of valid SD card sizes (which are multiples of # 512K).
As can be seen, the care was taken to pad the SD card image already, but seems that QEMU requirements got changed after that. And my change is indeed just a workaround, as it makes the image be padded to 256MB, which works as intended up to 512MB of the image size (and not practical for small images either).
A quick googling up led me to https://support.xilinx.com/s/article/76596 which says:
A check has been introduced in QEMU to see if image size is power of 2.
So, I assume it's a recent addition to Xilinx QEMU, though I didn't check the sources.