summaryrefslogtreecommitdiffstats
path: root/fs_mgr/fs_mgr.c
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-07-02 14:26:54 -0700
committerJP Abgrall <jpa@google.com>2014-07-02 14:28:50 -0700
commitcee206880ef80ac570df6b369d12f111c00f653a (patch)
tree562e7100d04e0325a9b1bbbe93dbf909402035c5 /fs_mgr/fs_mgr.c
parentf22b7452940c99b830749cabdd929f9f7cfdaacc (diff)
downloadsystem_core-cee206880ef80ac570df6b369d12f111c00f653a.zip
system_core-cee206880ef80ac570df6b369d12f111c00f653a.tar.gz
system_core-cee206880ef80ac570df6b369d12f111c00f653a.tar.bz2
[HACK]fs_mgr+init: Format via recovery if encryptable /data is wiped
If the encryptable partition is wiped (4KB worth of 0 or 0xff), then reboot into recovery to format /data+/cache This is while waiting for the Mac OS support to format f2fs. The flashstation running on Mac OS will currently just erase userdata and not format it with f2fs. Bug: 15720406 Bug: 15747366 Change-Id: Ib7cca3e1701483a09573457a835750f34da71ee0
Diffstat (limited to 'fs_mgr/fs_mgr.c')
-rw-r--r--fs_mgr/fs_mgr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index f01c562..3f94af5 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -387,10 +387,12 @@ int fs_mgr_mount_all(struct fstab *fstab)
/* mount(2) returned an error, check if it's encryptable and deal with it */
if (mret && mount_errno != EBUSY && mount_errno != EACCES &&
- fs_mgr_is_encryptable(&fstab->recs[i])) {
- if (partition_wiped(fstab->recs[i].blk_device)) {
- ERROR("%s(): Encryptable wiped partition %s. Recommend wiping via recovery. Fail for now.\n", __func__, fstab->recs[i].mount_point);
- ++error_count;
+ fs_mgr_is_encryptable(&fstab->recs[attempted_idx])) {
+ if(partition_wiped(fstab->recs[attempted_idx].blk_device)) {
+ ERROR("%s(): %s is wiped and %s %s is encryptable. Suggest recovery...\n", __func__,
+ fstab->recs[attempted_idx].blk_device, fstab->recs[attempted_idx].mount_point,
+ fstab->recs[attempted_idx].fs_type);
+ encryptable = FS_MGR_MNTALL_DEV_NEEDS_RECOVERY;
continue;
} else {
/* Need to mount a tmpfs at this mountpoint for now, and set