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

Commit efe22769 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents 2c45fa7d 9c228ce3
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