From 7032447a09c4722a30ebac54593be477fea25d12 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 14 Nov 2017 23:15:23 +1000 Subject: image-types-xilinx-qemu.bbclass: Add conversion type to pad for QEMU This image types class add the conversion type 'qemu-sd' to pad target images such that their size aligns with a 256K boundary. This is required due to how QEMU emulates SD cards from block devices, since QEMU truncates the size to match the 256K multiple of which SD cards advertise Signed-off-by: Nathan Rossi Signed-off-by: Manjukumar Matha --- classes/image-types-xilinx-qemu.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 classes/image-types-xilinx-qemu.bbclass (limited to 'classes') diff --git a/classes/image-types-xilinx-qemu.bbclass b/classes/image-types-xilinx-qemu.bbclass new file mode 100644 index 00000000..59dfabfc --- /dev/null +++ b/classes/image-types-xilinx-qemu.bbclass @@ -0,0 +1,10 @@ +# Define the 'qemu-sd' conversion type +# +# This conversion type pads any image to the 256K 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 +# 256K). + +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 %256K ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd" +CONVERSION_DEPENDS_qemu-sd = "coreutils-native" -- cgit v1.2.3-54-g00ecf