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 <Mike.Engel@digi.com>
This commit is contained in:
Mike Engel 2021-06-07 19:08:40 +02:00
parent 51babaa55b
commit 5c77cbb502
1 changed files with 11 additions and 4 deletions

View File

@ -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]\+\).*\<update\>.*,\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!"