From: Jacek Kryszyn Date: Mon, 12 Feb 2024 12:56:24 +0000 (+0100) Subject: Use resize-dynparts from delta file during OS Upgrade X-Git-Tag: accepted/tizen/unified/20240214.163949~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=587be5466fb4eb513a8233e49e28e7699c57c6ab;p=platform%2Fcore%2Fsystem%2Fupgrade.git Use resize-dynparts from delta file during OS Upgrade During OS Upgrade we can not rely on the scripts and programs available on the system, so from this point on, instead of using resize-dynparts that is on the system, we use the one provided in the delta file. Change-Id: I2ff7702dcab670d05e7366d573e461a79c3d06a6 --- diff --git a/scripts/upgrade-support/upgrade-common.inc b/scripts/upgrade-support/upgrade-common.inc index f429e4c..34e5e0d 100644 --- a/scripts/upgrade-support/upgrade-common.inc +++ b/scripts/upgrade-support/upgrade-common.inc @@ -18,6 +18,10 @@ if [ -z $BLKID_PRINT ]; then BLKID_PRINT="/usr/bin/blkid-print" fi +if [ -z $RESIZE_DYNPARTS ]; then + RESIZE_DYNPARTS="/bin/resize-dynparts" +fi + #------------------------------------------------ # critical_log msg [file] #------------------------------------------------ @@ -163,9 +167,9 @@ check_if_super() { # are copying partitions in background. In this case modify size of # NEXT_AB partitions to match size of CURRENT_AB partitions. if [ -f "${FOTA_DIR}/${CONFIG_FILE}" ]; then - /bin/resize-dynparts "${SUPERFS}" "${NEXT_AB}" "${FOTA_DIR}/${CONFIG_FILE}" + "${RESIZE_DYNPARTS}" "${SUPERFS}" "${NEXT_AB}" "${FOTA_DIR}/${CONFIG_FILE}" else - /bin/resize-dynparts "${SUPERFS}" "${NEXT_AB}" + "${RESIZE_DYNPARTS}" "${SUPERFS}" "${NEXT_AB}" fi PARSE_DYNPARTS=`/usr/sbin/parse-dynparts "$SUPERFS" --list-tables` diff --git a/scripts/upgrade-support/upgrade-partial.sh b/scripts/upgrade-support/upgrade-partial.sh index af090d8..fd99b2a 100755 --- a/scripts/upgrade-support/upgrade-partial.sh +++ b/scripts/upgrade-support/upgrade-partial.sh @@ -50,7 +50,6 @@ unpack_file "$DELTA_TAR" "upgrade-apply" /bin/chmod +x "$FOTA_DIR/upgrade-apply" unpack_file "$DELTA_TAR" "upgrade-apply-deltafs" /bin/chmod +x "$FOTA_DIR/upgrade-apply-deltafs" -BLKID_PRINT="$FOTA_DIR/blkid-print" if ! upgrade_images "$DELTA_TAR"; then critical_flog "[Error] Unable to upgrade_images" cleanup diff --git a/scripts/upgrade-support/upgrade-trigger.sh b/scripts/upgrade-support/upgrade-trigger.sh index 4084f65..fa1e783 100644 --- a/scripts/upgrade-support/upgrade-trigger.sh +++ b/scripts/upgrade-support/upgrade-trigger.sh @@ -18,9 +18,11 @@ SCRIPT_UPGRADE_PREPARE_PARTITIONS="upgrade-prepare-partitions.sh" SCRIPT_UPGRADE_PARTIAL="upgrade-partial.sh" SCRIPT_UPGRADE_FOTA="upgrade-fota.sh" BLKID_PRINT_FILE="blkid-print" +RESIZE_DYNPARTS_FILE="resize-dynparts" FLOCK_PATH="/var/lock/clone_partitions.lock" DELTA_VERIFIER="/usr/bin/delta-verifier" export BLKID_PRINT="$FOTA_DIR/$BLKID_PRINT_FILE" +export RESIZE_DYNPARTS="$FOTA_DIR/$RESIZE_DYNPARTS_FILE" prepare_fota_dir() { if [ -d "$FOTA_DIR" ]; then @@ -69,6 +71,9 @@ do_update() { unpack_file "${DOWNLOAD_DELTA}" "${BLKID_PRINT_FILE}" chmod +x "$FOTA_DIR/$BLKID_PRINT_FILE" + unpack_file "${DOWNLOAD_DELTA}" "${RESIZE_DYNPARTS_FILE}" + chmod +x "$FOTA_DIR/$RESIZE_DYNPARTS_FILE" + unpack_file "$DOWNLOAD_DELTA" "$CONFIG_FILE" if [ "$(device_board_get_partition_ab_cloned)" -eq 0 ]; then