From 9317527ce18034069b9c77d7ee94cbd4d205b9f9 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Mon, 20 Aug 2012 23:15:39 +0300 Subject: sdcard_image-rpi: Use xzcat if SDIMG_ROOTFS_TYPE is a .xz file When burning the rootfs partition we use dd if rootfs file is not compressed and xzcat piped with dd if rootfs file is a .xz file. [GITHUB #39] Signed-off-by: Andrei Gherzan --- classes/sdcard_image-rpi.bbclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass index f4d777e..e3c12d7 100644 --- a/classes/sdcard_image-rpi.bbclass +++ b/classes/sdcard_image-rpi.bbclass @@ -20,7 +20,7 @@ BOOTDD_VOLUME_ID ?= "${MACHINE}" # Addional space for boot partition BOOT_SPACE ?= "20MiB" -# Use an ext3 by default as rootfs +# Use an uncompressed ext3 by default as rootfs SDIMG_ROOTFS_TYPE ?= "ext3" SDIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" @@ -93,5 +93,11 @@ IMAGE_CMD_rpi-sdimg () { # Burn Partitions dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=1M && sync && sync - dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync + # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat + if [[ "$SDIMG_ROOTFS_TYPE" == *.xz ]] + then + xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync + else + dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync + fi } -- cgit v1.2.3-54-g00ecf