summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-05-14 04:12:24 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-14 04:12:24 +0000
commit3635e6485e640cc26bd87895498045fe8ded271c (patch)
tree27d1fbd836454e17ebc9f5cacd888ccf25b2f921
parentdfd32ca0b4500588795dc95ce451697f5e0b64ff (diff)
parent64331b37cb9e57e4f3378e4ccbc3ac0af6fbd3ce (diff)
Do not erase system_other if zero length. am: 64331b37cb
Change-Id: I24aef00f8f3ae9c3d0cc6fa43d420d22982bdfdc
-rw-r--r--dynamic_partition_control_android.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 7486d095..a9c2bb3b 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -656,6 +656,13 @@ bool DynamicPartitionControlAndroid::GetSystemOtherPath(
return true;
}
+ if (p->size() < AVB_FOOTER_SIZE) {
+ LOG(INFO) << partition_name_suffix << " has length " << p->size()
+ << "( < AVB_FOOTER_SIZE " << AVB_FOOTER_SIZE
+ << "), skip erasing.";
+ return true;
+ }
+
// Delete any pre-existing device with name |partition_name_suffix| and
// also remove it from |mapped_devices_|.
// In recovery, metadata might not be mounted, and