mirror of
git://git.yoctoproject.org/meta-raspberrypi.git
synced 2025-07-19 21:09:03 +02: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:
parent
221619ec83
commit
9317527ce1
|
@ -20,7 +20,7 @@ BOOTDD_VOLUME_ID ?= "${MACHINE}"
|
||||||
# Addional space for boot partition
|
# Addional space for boot partition
|
||||||
BOOT_SPACE ?= "20MiB"
|
BOOT_SPACE ?= "20MiB"
|
||||||
|
|
||||||
# Use an ext3 by default as rootfs
|
# Use an uncompressed ext3 by default as rootfs
|
||||||
SDIMG_ROOTFS_TYPE ?= "ext3"
|
SDIMG_ROOTFS_TYPE ?= "ext3"
|
||||||
SDIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}"
|
SDIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}"
|
||||||
|
|
||||||
|
@ -93,5 +93,11 @@ IMAGE_CMD_rpi-sdimg () {
|
||||||
|
|
||||||
# Burn Partitions
|
# Burn Partitions
|
||||||
dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=1M && sync && sync
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user