From bf8c73322b880198f8ef5b4c3f62b923bd654356 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Mon, 10 May 2021 16:31:33 +0200 Subject: [PATCH] swu: adapt swupdate packages to reworked partition encryption mechanism Since the recovery script checks the update package before installing it, use the package's description to indicate if the package is meant to encrypt the rootfs or not. Also, remove the pre-install script from the ccimx6ul packages, since the logic in the script to remove the encryption flag from the rootfs is now in the recovery script. https://onedigi.atlassian.net/browse/DEL-7174 Signed-off-by: Gabriel Valcazar --- .../swu-images/files/ccimx6ul/sw-description | 6 +++--- .../recipes-digi/swu-images/files/sw-description | 1 + meta-digi-dey/recipes-digi/swu-images/swu.inc | 10 ++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description index fb7072814..be20fab5f 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description @@ -1,20 +1,20 @@ software = { version = "##SW_VERSION##"; + description = "##DESCRIPTION##"; images: ( { filename = "##BOOTIMG_NAME##"; volume = "##BOOT_DEV##"; - type = "ubivol" + type = "ubivol"; sha256 = "@##BOOTIMG_NAME##"; }, { filename = "##ROOTIMG_NAME##"; volume = "##ROOTFS_DEV##"; - type = "ubivol" + type = "ubivol"; sha256 = "@##ROOTIMG_NAME##"; } ); - ##PREINSTALL_SCRIPT## } 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 cde521bf2..912af7be3 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description @@ -1,6 +1,7 @@ software = { version = "##SW_VERSION##"; + description = "##DESCRIPTION##"; images: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc index e16529718..8188324c4 100644 --- a/meta-digi-dey/recipes-digi/swu-images/swu.inc +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -6,7 +6,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425 SRC_URI = "file://sw-description" SRC_URI_append_ccimx6 = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', 'file://preinstall_swu.sh', '')}" -SRC_URI_append_ccimx6ul = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '', 'file://preinstall_swu.sh')}" SRC_URI_append_ccimx8x = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', 'file://preinstall_swu.sh', '')}" SRC_URI_append_ccimx8m = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', 'file://preinstall_swu.sh', '')}" @@ -19,6 +18,7 @@ IMG_NAME = "${IMAGE_DEPENDS}" SWUPDATE_IMAGES = "${IMG_NAME}" SOFTWARE_VERSION ?= "0.0.1" +DESCRIPTION = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', 'Encrypted rootfs ${IMG_NAME} update', '${IMG_NAME} update')}" BOOTFS_EXT ?= ".boot.vfat" BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" @@ -33,11 +33,8 @@ ROOTFS_ENC_DEV = "/dev/mapper/cryptrootfs" ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" PREINST_SCRIPT_TEMPLATE = "scripts: ( { filename = \\"preinstall_swu.sh\\"; type = \\"preinstall\\"; sha256 = \\"@preinstall_swu.sh\\"; \\x7D );" -PREINST_SCRIPT_DESC = "" -PREINST_SCRIPT_DESC_ccimx6 = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${PREINST_SCRIPT_TEMPLATE}', '')}" -PREINST_SCRIPT_DESC_ccimx6ul = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '', '${PREINST_SCRIPT_TEMPLATE}')}" -PREINST_SCRIPT_DESC_ccimx8x = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${PREINST_SCRIPT_TEMPLATE}', '')}" -PREINST_SCRIPT_DESC_ccimx8m = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${PREINST_SCRIPT_TEMPLATE}', '')}" +PREINST_SCRIPT_DESC = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${PREINST_SCRIPT_TEMPLATE}', '')}" +PREINST_SCRIPT_DESC_ccimx6ul = "" python () { img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) @@ -63,5 +60,6 @@ fill_description() { sed -i -e "s,##ROOTIMG_NAME##,${IMG_NAME}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${WORKDIR}/sw-description" sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" + sed -i -e "s,##DESCRIPTION##,${DESCRIPTION},g" "${WORKDIR}/sw-description" sed -i -e "s/##PREINSTALL_SCRIPT##/${PREINST_SCRIPT_DESC}/g" "${WORKDIR}/sw-description" }