summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2014-08-05 19:49:09 -0700
committerAndres Morales <anmorales@google.com>2014-08-06 09:58:55 -0700
commitee19387905650cab5da7dd97ada5502cd17ac93d (patch)
tree46f1c336bce478470cf2b45511f7a55c61db5021 /recovery.cpp
parenta91ecc59b2753a3dcc93b2619559a980074e77bd (diff)
downloadbootable_recovery-ee19387905650cab5da7dd97ada5502cd17ac93d.zip
bootable_recovery-ee19387905650cab5da7dd97ada5502cd17ac93d.tar.gz
bootable_recovery-ee19387905650cab5da7dd97ada5502cd17ac93d.tar.bz2
Erase PST partition if its marked to be erased.
We need to wipe the challenges on this partition if OEM unlock is enabled, as this is a signal that the user has opted out of factory reset protection. go/factory-reset Bug: 16633064 Change-Id: Icb8f1433bf99ca57813f5b72d5a3dd15fa94a263
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/recovery.cpp b/recovery.cpp
index d2d85e7..f78d6e4 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -659,6 +659,7 @@ wipe_data(int confirm, Device* device) {
device->WipeData();
erase_volume("/data");
erase_volume("/cache");
+ erase_persistent_partition();
ui->Print("Data wipe complete.\n");
}
@@ -959,6 +960,7 @@ main(int argc, char **argv) {
if (device->WipeData()) status = INSTALL_ERROR;
if (erase_volume("/data")) status = INSTALL_ERROR;
if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;
+ if (erase_persistent_partition() == -1 ) status = INSTALL_ERROR;
if (status != INSTALL_SUCCESS) ui->Print("Data wipe failed.\n");
} else if (wipe_cache) {
if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;