aboutsummaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2015-03-30 20:56:57 +0000
committerTao Bao <tbao@google.com>2015-03-31 09:48:50 -0700
commitc277762de13653f73451e1a21fe73eafc51f918e (patch)
tree2dfb0dec13b9285f209d32e7f6d7a1436743c0cc /roots.cpp
parent20e82d4fb6b4ba8520bd46db2982495f0b627ed1 (diff)
downloadbootable_recovery-c277762de13653f73451e1a21fe73eafc51f918e.zip
bootable_recovery-c277762de13653f73451e1a21fe73eafc51f918e.tar.gz
bootable_recovery-c277762de13653f73451e1a21fe73eafc51f918e.tar.bz2
Revert "Erase PST partition if its marked to be erased."
This now gets done at the framework level. Doing it here breaks the signature on the partition. This reverts commit ee19387905650cab5da7dd97ada5502cd17ac93d. Bug: 19967123 Change-Id: I2a977cb0f0ba94defa1bf9091219398ddc1d3528 (cherry picked from commit 037444642bc32d8fed3bb996823b6a62faa57195)
Diffstat (limited to 'roots.cpp')
-rw-r--r--roots.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/roots.cpp b/roots.cpp
index 0d47577..ee14016 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -39,8 +39,6 @@ static struct fstab *fstab = NULL;
extern struct selabel_handle *sehandle;
-static const char* PERSISTENT_PATH = "/persistent";
-
void load_volume_table()
{
int i;
@@ -266,41 +264,6 @@ int format_volume(const char* volume) {
return -1;
}
-int erase_persistent_partition() {
- Volume *v = volume_for_path(PERSISTENT_PATH);
- if (v == NULL) {
- // most devices won't have /persistent, so this is not an error.
- return 0;
- }
-
- int fd = open(v->blk_device, O_RDWR);
- uint64_t size = get_file_size(fd);
- if (size == 0) {
- LOGE("failed to stat size of /persistent\n");
- close(fd);
- return -1;
- }
-
- char oem_unlock_enabled;
- lseek(fd, size - 1, SEEK_SET);
- read(fd, &oem_unlock_enabled, 1);
-
- if (oem_unlock_enabled) {
- if (wipe_block_device(fd, size)) {
- LOGE("error wiping /persistent: %s\n", strerror(errno));
- close(fd);
- return -1;
- }
-
- lseek(fd, size - 1, SEEK_SET);
- write(fd, &oem_unlock_enabled, 1);
- }
-
- close(fd);
-
- return (int) oem_unlock_enabled;
-}
-
int setup_install_mounts() {
if (fstab == NULL) {
LOGE("can't set up install mounts: no fstab loaded\n");