Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2a4f41b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "apply-update: Add option to boot device off snapshots" into main am:...

Merge "apply-update: Add option to boot device off snapshots" into main am: efe22769 am: 741522fc

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3524958



Change-Id: I35b85211208356e455c07b59e894d98349ffb089
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b0c915fd 741522fc
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ Options:
                            Now, the script can safely use this flag for update purpose.

  --wipe                   Wipe user data during the update.
  --boot_snapshot          Boot the device off snapshots - No data wipe is supported
                              To revert back to original state - `adb shell snapshotctl revert-snapshots`
  --help                   Display this help message.

Environment Variables:
@@ -123,6 +125,7 @@ EOF
}

skip_static_partitions=0
boot_snapshot=0
flash_bootloader=1
wipe_flag=0
help_flag=0
@@ -139,6 +142,9 @@ for arg in "$@"; do
    --skip_bootloader)
      flash_bootloader=0
      ;;
    --boot_snapshot)
      boot_snapshot=1
      ;;
    --help)
      help_flag=1
      ;;
@@ -208,7 +214,9 @@ adb push -q $HOST_PATH/*.patch $DEVICE_PATH

log_message "Applying update"

if (( wipe_flag )); then
if (( boot_snapshot)); then
  adb shell snapshotctl map-snapshots $DEVICE_PATH
elif (( wipe_flag )); then
  adb shell snapshotctl apply-update $DEVICE_PATH -w
else
  adb shell snapshotctl apply-update $DEVICE_PATH