Adding error for when overlayfs is enabled in OTA
when running adb remount, overlayfs is enabled on the device interfering
with OTA being able to run. Currently we don't have a good debug message
and users aren't able to realize why the OTA fails. Adding this log will
make it clear this behavior is intended, and we need verity-enabled for
OTA to work
Test: adb remount, update_device.py
Bug: 286889613
Change-Id: Ibcd27911afe6f02ddf0c38ad40904a7e17735b31
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
index 0c834ad..fcb142e 100644
--- a/aosp/update_attempter_android.cc
+++ b/aosp/update_attempter_android.cc
@@ -1218,12 +1218,23 @@
string payload_id = GetPayloadId(headers);
uint64_t required_size = 0;
+ ErrorCode error_code{};
+
if (!DeltaPerformer::PreparePartitionsForUpdate(prefs_,
boot_control_,
GetTargetSlot(),
manifest,
payload_id,
- &required_size)) {
+ &required_size,
+ &error_code)) {
+ if (error_code == ErrorCode::kOverlayfsenabledError) {
+ LogAndSetError(error,
+ __LINE__,
+ __FILE__,
+ "OverlayFS Shouldn't be enabled for OTA.",
+ error_code);
+ return 0;
+ }
if (required_size == 0) {
LogAndSetGenericError(
error, __LINE__, __FILE__, "Failed to allocate space for payload.");
@@ -1300,6 +1311,7 @@
std::make_unique<PostinstallRunnerAction>(boot_control_, hardware_);
SetStatusAndNotify(UpdateStatus::VERIFYING);
postinstall_runner_action->set_delegate(this);
+ ErrorCode error_code{};
// If last error code is kUpdatedButNotActive, we know that we reached this
// state by calling applyPayload() with switch_slot=false. That applyPayload()
@@ -1314,11 +1326,11 @@
GetTargetSlot(),
manifest,
false /* should update */,
- nullptr)) {
+ nullptr,
+ &error_code)) {
return LogAndSetGenericError(
error, __LINE__, __FILE__, "Failed to PreparePartitionsForUpdate");
}
- ErrorCode error_code{};
if (!install_plan_.ParsePartitions(manifest.partitions(),
boot_control_,
manifest.block_size(),