Enable metadata encryption for userdata_gsi.
When running a live GSI, userdata is a logical partition. If we don't
fix up the fstab we'll derive the underlying block device instead of
the device-mapper node for userdat_gsi, resulting in a corrupt data
partition for both images.
Bug: 123906417
Test: manual test
Change-Id: Ic0101f30504de26e725442da2da3888008c31b63
diff --git a/main.cpp b/main.cpp
index b930941..687a0a9 100644
--- a/main.cpp
+++ b/main.cpp
@@ -226,7 +226,7 @@
*has_adoptable = false;
*has_quota = false;
*has_reserved = false;
- for (const auto& entry : fstab_default) {
+ for (auto& entry : fstab_default) {
if (entry.fs_mgr_flags.quota) {
*has_quota = true;
}
@@ -234,6 +234,11 @@
*has_reserved = true;
}
+ /* Make sure logical partitions have an updated blk_device. */
+ if (entry.fs_mgr_flags.logical && !fs_mgr_update_logical_partition(&entry)) {
+ PLOG(FATAL) << "could not find logical partition " << entry.blk_device;
+ }
+
if (entry.fs_mgr_flags.vold_managed) {
if (entry.fs_mgr_flags.nonremovable) {
LOG(WARNING) << "nonremovable no longer supported; ignoring volume";