diff options
Diffstat (limited to 'fastboot/device/flashing.cpp')
-rw-r--r-- | fastboot/device/flashing.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fastboot/device/flashing.cpp b/fastboot/device/flashing.cpp index ee0aa582b..a5f12231e 100644 --- a/fastboot/device/flashing.cpp +++ b/fastboot/device/flashing.cpp @@ -27,7 +27,6 @@ #include <android-base/file.h> #include <android-base/logging.h> -#include <android-base/properties.h> #include <android-base/strings.h> #include <ext4_utils/ext4_utils.h> #include <fs_mgr_overlayfs.h> @@ -68,7 +67,7 @@ void WipeOverlayfsForPartition(FastbootDevice* device, const std::string& partit if ((partition + device->GetCurrentSlot()) == partition_name) { mount_metadata.emplace(); - android::fs_mgr::TeardownAllOverlayForMountPoint(entry.mount_point); + fs_mgr_overlayfs_teardown(entry.mount_point.c_str()); } } } @@ -163,12 +162,8 @@ int Flash(FastbootDevice* device, const std::string& partition_name) { partition_name == "boot_b")) { CopyAVBFooter(&data, block_device_size); } - if (android::base::GetProperty("ro.system.build.type", "") != "user") { - WipeOverlayfsForPartition(device, partition_name); - } - int result = FlashBlockDevice(handle.fd(), data); - sync(); - return result; + WipeOverlayfsForPartition(device, partition_name); + return FlashBlockDevice(handle.fd(), data); } bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wipe) { @@ -197,8 +192,7 @@ bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wip if (!FlashPartitionTable(super_name, *new_metadata.get())) { return device->WriteFail("Unable to flash new partition table"); } - android::fs_mgr::TeardownAllOverlayForMountPoint(); - sync(); + fs_mgr_overlayfs_teardown(); return device->WriteOkay("Successfully flashed partition table"); } @@ -237,7 +231,6 @@ bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wip if (!UpdateAllPartitionMetadata(device, super_name, *new_metadata.get())) { return device->WriteFail("Unable to write new partition table"); } - android::fs_mgr::TeardownAllOverlayForMountPoint(); - sync(); + fs_mgr_overlayfs_teardown(); return device->WriteOkay("Successfully updated partition table"); } |