Reserve the last 16 Kbytes of /data for the crypto footer.
When formatting /data, if it's an ext4 filesystem, reserve the
last 16 Kbytes for the crypto footer.
Change-Id: I7b401d851ee87732e5da5860df0287a1c331c5b7
diff --git a/roots.c b/roots.c
index 92ce789..5731d74 100644
--- a/roots.c
+++ b/roots.c
@@ -238,8 +238,12 @@
}
if (strcmp(v->fs_type, "ext4") == 0) {
- reset_ext4fs_info();
- int result = make_ext4fs(v->device, NULL, NULL, 0, 0, 0, 0);
+ s64 len = 0;
+
+ if (strcmp(volume, "/data") == 0) {
+ len = -16384; /* Reserve 16 Kbytes for the crypto footer */
+ }
+ int result = make_ext4fs(v->device, len);
if (result != 0) {
LOGE("format_volume: make_extf4fs failed on %s\n", v->device);
return -1;