image_types_phosphor.bbclass: mmc tar: Compress ext4 rootfs
Compress the ext4 rootfs so that it's faster to transfer to the
BMC and does not take much space. The code update process can
then uncompress it on the fly and write to flash.
Use zstd to compress which has a good compression rate and is also
faster to decompress than xz.
(From meta-phosphor rev: 5e1b6dc499736e219766cc24924dd486ff2a8ccb)
Change-Id: I07aadc413e5e883a6b97d1a374e4bbf215b07786
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
index 0d2ed89..8f92f70 100644
--- a/meta-phosphor/classes/image_types_phosphor.bbclass
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -512,14 +512,16 @@
"
do_generate_ext4_tar() {
+ zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${FLASH_EXT4_BASETYPE} > ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${FLASH_EXT4_BASETYPE}.zst
ln -sf ${S}/MANIFEST MANIFEST
ln -sf ${S}/publickey publickey
- make_image_links rwfs.${FLASH_EXT4_OVERLAY_BASETYPE} ${FLASH_EXT4_BASETYPE}
+ make_image_links rwfs.${FLASH_EXT4_OVERLAY_BASETYPE} ${FLASH_EXT4_BASETYPE}.zst
make_signatures image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey
make_tar_of_images ext4.mmc MANIFEST publickey ${signature_files}
}
do_generate_ext4_tar[dirs] = " ${S}/ext4"
do_generate_ext4_tar[depends] += " \
+ zstd-native:do_populate_sysroot \
${PN}:do_image_${FLASH_EXT4_BASETYPE} \
virtual/kernel:do_deploy \
u-boot:do_populate_sysroot \