Use FileDescriptorPtr to implement async reads in verify stage
During FileSystemVerify stage, update_engine needs to read from source
or target partition to verify hashes && write verity. Previously we use
brillow's file stream to implement async reads. WIth Virtual AB
Compression, reading from target partition must go through libsnapshot's
interface(FileDescriptorPtr). So we replace brillo::FileStream with
FileDescriptorPtr for ease of integrating with VABC.
Test: serve an OTA update, verify: slot switch resume, regular resume
Change-Id: Id8531757468f60e3e21667b7761b83f7c2af2dbf
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index d95103b..980f2ca 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -111,6 +111,12 @@
return true;
}
+[[nodiscard]] bool VABCPartitionWriter::FinishedInstallOps() {
+ // Add a hardcoded magic label to indicate end of all install ops. This label
+ // is needed by filesystem verification, don't remove.
+ return cow_writer_->AddLabel(kEndOfInstallLabel);
+}
+
VABCPartitionWriter::~VABCPartitionWriter() {
cow_writer_->Finalize();
}