summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-05-14 18:41:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-14 18:41:06 +0000
commit46aa61ec5917fc5339fce61e21dd4a0980eb63ef (patch)
tree127383ad3b8153f281714d3bc2f92f6ce8221995
parent4b28a53926e27d47fac7784be553c494ae44753f (diff)
parenta74d2f0ef5a9431b6833c60ee618a7135eb9328e (diff)
Merge "Do not erase system_other if zero length." into rvc-dev
-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 48ad5f03..5ed604ab 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -647,6 +647,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