From 5c77cbb50296c852bc56d9c15d738f3de4acda87 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 7 Jun 2021 19:08:40 +0200 Subject: [PATCH] recovery: add swupdate parameter to select image description. This commit adds some swupdate parameter to select the sw-description configuration depending on the used platform. Signed-off-by: Mike Engel --- .../recovery-initramfs/recovery-initramfs-init | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 132bdb7df..61a02119d 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -377,9 +377,9 @@ check_swu_package() { # Check software update package. if [ -f "${PUBLIC_KEY}" ]; then - swupdate -c -v -i "${update_package}" -k "${PUBLIC_KEY}" > "${SWUPDATE_OUTPUT}" + swupdate -c -v -i "${update_package}" -e "${SWUPDATE_IMAGE_SET}" -k "${PUBLIC_KEY}" > "${SWUPDATE_OUTPUT}" else - swupdate -c -v -i "${update_package}" > "${SWUPDATE_OUTPUT}" + swupdate -c -v -e "${SWUPDATE_IMAGE_SET}" -i "${update_package}" > "${SWUPDATE_OUTPUT}" fi if [ "$?" != "0" ]; then @@ -572,6 +572,13 @@ for p in ${BLACKLISTED}; do encrypt_partitions=$(remove_entry "${encrypt_partitions}" "${p}") done +# Select update package image +if [ "$(is_nand)" = "yes" ]; then + SWUPDATE_IMAGE_SET="mtd,platform" +else + SWUPDATE_IMAGE_SET="mmc,platform" +fi + # On eMMC, if the 'update' partition is encrypted, we need to mount it manually if [ "$(is_nand)" = "no" ] && contains "${ENC_PARTS}" "update"; then update_block="/dev/mmcblk0p$(fdisk -l /dev/mmcblk0 | sed -ne "s,^[^0-9]*\([0-9]\+\).*\.*,\1,g;T;p")" @@ -804,9 +811,9 @@ if [ -n "${update_package_bool}" ]; then progress -wp & # Execute the software update. if [ -f "${PUBLIC_KEY}" ]; then - swupdate -f "${SW_CONFIG}" -i "${update_package}" -k "${PUBLIC_KEY}" + swupdate -e "${SWUPDATE_IMAGE_SET}" -f "${SW_CONFIG}" -i "${update_package}" -k "${PUBLIC_KEY}" else - swupdate -f "${SW_CONFIG}" -i "${update_package}" + swupdate -e "${SWUPDATE_IMAGE_SET}" -f "${SW_CONFIG}" -i "${update_package}" fi if [ "$?" = "0" ]; then log "Firmware update process succeed!"