Run scripts from the path where upgrade-trigger.sh is 23/271123/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 15 Feb 2022 13:16:55 +0000 (14:16 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 21 Feb 2022 14:26:26 +0000 (15:26 +0100)
Upgrade scripts like:

  upgrade-trigger.sh
  upgrade-fota.sh
  upgrade-partia.sh
  upgrade-prepare-partitions.sh

should be run from the path to which they were extracted from the
delta.tar.

Change-Id: Ic7fb2869ca41fa223997d18d9546fa01f258d609

scripts/upgrade-trigger.sh

index ceb2b2abd58153b8b2154612a487e08594e47ecd..6f9258d556dacded4f741335d8b35b6343ec7bfc 100755 (executable)
@@ -12,6 +12,7 @@ IMG_VERIFIER="/usr/sbin/img-verifier"
 
 SCRIPT_NAME="upgrade-trigger.sh"
 LOG_FILE="/tmp/upgrade-trigger.log"
+SCRIPT_DIR=$(dirname -- "${BASH_SOURCE[0]}")
 #------------------------------------------------
 #       log msg [file]
 #------------------------------------------------
@@ -30,13 +31,13 @@ check_ab_partition_scheme() {
                log "[Info] Launching legacy update without A|B partition scheme" "$LOG_FILE"
        else
                log "[Info] Launching new update with A|B partition scheme" "$LOG_FILE"
-               if ! upgrade-prepare-partitions.sh; then
+               if ! "${SCRIPT_DIR}"/upgrade-prepare-partitions.sh; then
                        exit 1
                fi
-               if ! upgrade-partial.sh "$DOWNLOAD_DELTA"; then
+               if ! "${SCRIPT_DIR}"/upgrade-partial.sh "$DOWNLOAD_DELTA"; then
                        exit 1
                fi
-               if ! upgrade-fota.sh; then
+               if ! "${SCRIPT_DIR}"/upgrade-fota.sh; then
                        exit 1
                fi
                exit 0