libsnapshot: Cleanup temp metadata during rollback

Bug: 380471512
Test: Test rollback and check metadata is cleared
Change-Id: I4ebd5d9842409fa32c58bb482ffc0066817a5a05
Signed-off-by: Akilesh Kailash <akailash@google.com>
This commit is contained in:
Akilesh Kailash 2024-12-02 10:58:46 -08:00
parent db80953238
commit 00a32314ac

View file

@ -2404,6 +2404,9 @@ bool SnapshotManager::NeedSnapshotsInFirstStageMount() {
PLOG(ERROR) << "Unable to write rollback indicator: " << path;
} else {
LOG(INFO) << "Rollback detected, writing rollback indicator to " << path;
if (device_->IsTempMetadata()) {
CleanupScratchOtaMetadataIfPresent();
}
}
}
LOG(INFO) << "Not booting from new slot. Will not mount snapshots.";