mirror of
https://github.com/agherzan/meta-raspberrypi.git
synced 2025-12-06 06:19:11 +00:00
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>
This commit is contained in:
@@ -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
|
||||
# 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user