Don't verify source partition in full update.
Change-Id: I3ecee9e93f51ff71e7e173cf532a541858b38020
Test: ./update_engine_unittests
Bug: 26972259
diff --git a/payload_consumer/filesystem_verifier_action.cc b/payload_consumer/filesystem_verifier_action.cc
index bd4285e..4b476db 100644
--- a/payload_consumer/filesystem_verifier_action.cc
+++ b/payload_consumer/filesystem_verifier_action.cc
@@ -217,9 +217,12 @@
if (partition.target_hash != hasher_->raw_hash()) {
LOG(ERROR) << "New '" << partition.name
<< "' partition verification failed.";
+ if (install_plan_.payload_type == InstallPayloadType::kFull)
+ return Cleanup(ErrorCode::kNewRootfsVerificationError);
// If we have not verified source partition yet, now that the target
- // partition does not match, we need to switch to kVerifySourceHash step
- // to check if it's because the source partition does not match either.
+ // partition does not match, and it's not a full payload, we need to
+ // switch to kVerifySourceHash step to check if it's because the source
+ // partition does not match either.
verifier_step_ = VerifierStep::kVerifySourceHash;
partition_index_ = 0;
} else {