From 6a70b52356b75f0524914181c0b971a09a077da5 Mon Sep 17 00:00:00 2001 From: Francisco Gil Date: Fri, 2 Jun 2023 09:38:26 +0200 Subject: [PATCH] sw-update: read-only: modify swu descriptor for squashfs rootfs When a squashfs image is flashed we need to delete the compression field in the swupdate descriptor. Also the rootfstype u-boot variable needs to be set to squashfs. https://onedigi.atlassian.net/browse/DEL-8558 Signed-off-by: Francisco Gil --- .../recipes-digi/swu-images/files/sw-description | 16 ++++++++++++++++ meta-digi-dey/recipes-digi/swu-images/swu.inc | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/sw-description index ddd469d42..8d0af5f13 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description @@ -26,6 +26,10 @@ software = { name = "upgrade_available"; value = "1"; + }, + { + name = "rootfstype" + value = "##ROOTFS_TYPE##" } ); } @@ -51,6 +55,10 @@ software = { name = "upgrade_available"; value = "1"; + }, + { + name = "rootfstype" + value = "##ROOTFS_TYPE##" } ); } @@ -99,6 +107,10 @@ software = { name = "upgrade_available"; value = "1"; + }, + { + name = "rootfstype" + value = "##ROOTFS_TYPE##" } ); } @@ -123,6 +135,10 @@ software = { name = "upgrade_available"; value = "1"; + }, + { + name = "rootfstype" + value = "##ROOTFS_TYPE##" } ); } diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc index f3e35c8ef..444615d1e 100644 --- a/meta-digi-dey/recipes-digi/swu-images/swu.inc +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -58,6 +58,7 @@ BOOT_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p2 ROOTFS_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p3', 'rootfs_a', d)}" ROOTFS_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p4', 'rootfs_b', d)}" +ROOTFS_TYPE = "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', 'squashfs', '', d)}" do_unpack[postfuncs] += "fill_description" fill_description() { @@ -84,4 +85,9 @@ fill_description() { sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description" sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description" sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description" + if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then + sed -i '/compressed/d' "${WORKDIR}/sw-description" + fi + sed -i -e "s,##ROOTFS_TYPE##,${ROOTFS_TYPE},g" "${WORKDIR}/sw-description" + }