summaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2015-03-30 22:56:57 +0200
committerAndres Morales <anmorales@google.com>2015-04-02 00:43:35 +0200
commitc94fa0b01b43709531dfbcdb94abb2a1cc23be3d (patch)
tree4fe170dd5cbb6a0f3b61576538e301d9d7c1bfff /roots.cpp
parentupdater: Check the return value from ApplyImagePatch / ApplyBSDiffPatch (diff)
downloadandroid_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar.gz
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar.bz2
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar.lz
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar.xz
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.tar.zst
android_bootable_recovery-c94fa0b01b43709531dfbcdb94abb2a1cc23be3d.zip
Diffstat (limited to '')
-rw-r--r--roots.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/roots.cpp b/roots.cpp
index 0d47577b2..ee140160c 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");