ccimx6ul/ccmp1: compress recovery UBIFS image using zlib to reduce its size

This compression method has a better compression ratio than the default (lzo),
but the (de)compression speed is slower, leading to slower read/write speeds.
However, the recovery partition only gets accessed in specific use cases such
as software updates and partition encryption, and it contains an initramfs. The
UBIFS will only be read at boot time to load its elements, but once the
initramfs is loaded in RAM, there are no more read/write operations to the
UBIFS during runtime, so the speed penalty is minimal.

Take advantage of the improved compression ratio to reduce the size of the
recovery image. On the ccimx6ul, the size is reduced by 248 KiB.

https://onedigi.atlassian.net/browse/DEL-8819
https://onedigi.atlassian.net/browse/DEL-8825

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2024-01-02 13:44:09 +01:00
parent 82a96801de
commit 604dcbc20f
4 changed files with 13 additions and 1 deletions

View File

@ -204,7 +204,7 @@ IMAGE_CMD:recovery.ubifs() {
fi
# Build UBIFS recovery image out of temp folder
mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_BOOT_ARGS}
mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_RECOVERY_ARGS}
# Remove the temporary folder
rm -rf ${TMP_RECOVERYDIR}

View File

@ -123,6 +123,10 @@ IMAGE_CLASSES = "image_types_digi image_types-stubi"
# Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size.
MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255"
# mkfs.ubifs parameters for recovery partition
# Same parameters as the boot partition, but using zlib compression to reduce image size.
MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib"
# mkfs.ubifs parameters for rootfs partition
# Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size.
MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191"

View File

@ -132,6 +132,10 @@ IMAGE_CLASSES = "image_types_digi image_types-stubi"
# Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size.
MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255"
# mkfs.ubifs parameters for recovery partition
# Same parameters as the boot partition, but using zlib compression to reduce image size.
MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib"
# mkfs.ubifs parameters for rootfs partition
# Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size.
MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191"

View File

@ -41,6 +41,10 @@ MACHINE_FEATURES:remove:use-mainline-bsp = "wifi"
# Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size.
MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255"
# mkfs.ubifs parameters for recovery partition
# Same parameters as the boot partition, but using zlib compression to reduce image size.
MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib"
# mkfs.ubifs parameters for rootfs partition
# Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size.
MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191"