diff options
| author | Andrei Gherzan <andrei@gherzan.ro> | 2012-08-20 23:15:39 +0300 |
|---|---|---|
| committer | Andrei Gherzan <andrei@gherzan.ro> | 2012-08-28 23:59:28 +0300 |
| commit | 9317527ce18034069b9c77d7ee94cbd4d205b9f9 (patch) | |
| tree | f80239c957d534c12bd81b93a5828ed566d69050 | |
| parent | 221619ec8367b93970b7100c1a7e3cb80ec13e78 (diff) | |
| download | meta-raspberrypi-9317527ce18034069b9c77d7ee94cbd4d205b9f9.tar.gz | |
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 <andrei@gherzan.ro>
| -rw-r--r-- | classes/sdcard_image-rpi.bbclass | 10 |
1 files 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}" | |||
| 20 | # Addional space for boot partition | 20 | # Addional space for boot partition |
| 21 | BOOT_SPACE ?= "20MiB" | 21 | BOOT_SPACE ?= "20MiB" |
| 22 | 22 | ||
| 23 | # Use an ext3 by default as rootfs | 23 | # Use an uncompressed ext3 by default as rootfs |
| 24 | SDIMG_ROOTFS_TYPE ?= "ext3" | 24 | SDIMG_ROOTFS_TYPE ?= "ext3" |
| 25 | SDIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" | 25 | SDIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" |
| 26 | 26 | ||
| @@ -93,5 +93,11 @@ IMAGE_CMD_rpi-sdimg () { | |||
| 93 | 93 | ||
| 94 | # Burn Partitions | 94 | # Burn Partitions |
| 95 | dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=1M && sync && sync | 95 | dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=1M && sync && sync |
| 96 | dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync | 96 | # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat |
| 97 | if [[ "$SDIMG_ROOTFS_TYPE" == *.xz ]] | ||
| 98 | then | ||
| 99 | xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync | ||
| 100 | else | ||
| 101 | dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} && sync && sync | ||
| 102 | fi | ||
| 97 | } | 103 | } |
