diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh index 48ecd611a..811f895cb 100755 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh @@ -101,6 +101,18 @@ INSTALL_LINUX_FILENAME="${BASEFILENAME}-##MACHINE##.boot.vfat" INSTALL_RECOVERY_FILENAME="${BASEFILENAME}-##MACHINE##.recovery.vfat" INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.ext4" +COMPRESSED_ROOTFS_IMAGE="${INSTALL_ROOTFS_FILENAME}.gz" + +# If the rootfs image is compressed, make sure to decompress it before the update +if [ -f ${COMPRESSED_ROOTFS_IMAGE} ] && [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then + echo "\033[36m" + echo "=====================================================================================" + echo "Decompressing rootfs image '${COMPRESSED_ROOTFS_IMAGE}'" + echo "=====================================================================================" + echo "\033[0m" + gzip -d -k -f "${COMPRESSED_ROOTFS_IMAGE}" +fi + # Verify existance of files before starting the update FILES="${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}" for f in ${FILES}; do @@ -198,6 +210,11 @@ part_update "recovery" "${INSTALL_RECOVERY_FILENAME}" # Update Rootfs part_update "rootfs" "${INSTALL_ROOTFS_FILENAME}" +# If the rootfs image was originally compressed, remove the uncompressed image +if [ -f ${COMPRESSED_ROOTFS_IMAGE} ] && [ -f ${INSTALL_ROOTFS_FILENAME} ]; then + rm -f "${INSTALL_ROOTFS_FILENAME}" +fi + # Configure u-boot to boot into recovery mode uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index 6748d1095..a07ed7777 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -163,6 +163,18 @@ INSTALL_LINUX_FILENAME="${BASEFILENAME}-##MACHINE##.boot.vfat" INSTALL_RECOVERY_FILENAME="${BASEFILENAME}-##MACHINE##.recovery.vfat" INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.ext4" +COMPRESSED_ROOTFS_IMAGE="${INSTALL_ROOTFS_FILENAME}.gz" + +# If the rootfs image is compressed, make sure to decompress it before the update +if [ -f ${COMPRESSED_ROOTFS_IMAGE} ] && [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then + echo "\033[36m" + echo "=====================================================================================" + echo "Decompressing rootfs image '${COMPRESSED_ROOTFS_IMAGE}'" + echo "=====================================================================================" + echo "\033[0m" + gzip -d -k -f "${COMPRESSED_ROOTFS_IMAGE}" +fi + # Verify existance of files before starting the update FILES="${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}" for f in ${FILES}; do @@ -260,6 +272,11 @@ part_update "recovery" "${INSTALL_RECOVERY_FILENAME}" # Update Rootfs part_update "rootfs" "${INSTALL_ROOTFS_FILENAME}" +# If the rootfs image was originally compressed, remove the uncompressed image +if [ -f ${COMPRESSED_ROOTFS_IMAGE} ] && [ -f ${INSTALL_ROOTFS_FILENAME} ]; then + rm -f "${INSTALL_ROOTFS_FILENAME}" +fi + # Configure u-boot to boot into recovery mode uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update