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 <nat...@nathanrossi.com>
---
Changes in v3:
 * NEW
---
 classes/image-types-xilinx-qemu.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 classes/image-types-xilinx-qemu.bbclass

diff --git a/classes/image-types-xilinx-qemu.bbclass 
b/classes/image-types-xilinx-qemu.bbclass
new file mode 100644
index 0000000000..59dfabfcc9
--- /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"
-- 
2.15.0


-- 
_______________________________________________
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx

Reply via email to