123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- #ifndef UPDATE_ENGINE_PAYLOAD_GENERATOR_AB_GENERATOR_H_
- #define UPDATE_ENGINE_PAYLOAD_GENERATOR_AB_GENERATOR_H_
- #include <string>
- #include <vector>
- #include <base/macros.h>
- #include <brillo/secure_blob.h>
- #include "update_engine/payload_consumer/payload_constants.h"
- #include "update_engine/payload_generator/blob_file_writer.h"
- #include "update_engine/payload_generator/extent_utils.h"
- #include "update_engine/payload_generator/filesystem_interface.h"
- #include "update_engine/payload_generator/operations_generator.h"
- #include "update_engine/payload_generator/payload_generation_config.h"
- #include "update_engine/update_metadata.pb.h"
- namespace chromeos_update_engine {
- class ABGenerator : public OperationsGenerator {
- public:
- ABGenerator() = default;
-
-
-
-
-
-
-
-
- bool GenerateOperations(const PayloadGenerationConfig& config,
- const PartitionConfig& old_part,
- const PartitionConfig& new_part,
- BlobFileWriter* blob_file,
- std::vector<AnnotatedOperation>* aops) override;
-
-
-
-
-
-
-
- static bool FragmentOperations(const PayloadVersion& version,
- std::vector<AnnotatedOperation>* aops,
- const std::string& target_part_path,
- BlobFileWriter* blob_file);
-
-
-
- static void SortOperationsByDestination(
- std::vector<AnnotatedOperation>* aops);
-
-
-
-
-
-
-
-
-
- static bool SplitSourceCopy(const AnnotatedOperation& original_aop,
- std::vector<AnnotatedOperation>* result_aops);
-
-
-
-
- static bool SplitAReplaceOp(const PayloadVersion& version,
- const AnnotatedOperation& original_aop,
- const std::string& target_part,
- std::vector<AnnotatedOperation>* result_aops,
- BlobFileWriter* blob_file);
-
-
-
-
-
-
-
-
-
- static bool MergeOperations(std::vector<AnnotatedOperation>* aops,
- const PayloadVersion& version,
- size_t chunk_blocks,
- const std::string& target_part,
- BlobFileWriter* blob_file);
-
-
- static bool AddSourceHash(std::vector<AnnotatedOperation>* aops,
- const std::string& source_part_path);
- private:
-
-
-
-
-
-
-
- static bool AddDataAndSetType(AnnotatedOperation* aop,
- const PayloadVersion& version,
- const std::string& target_part_path,
- BlobFileWriter* blob_file);
- DISALLOW_COPY_AND_ASSIGN(ABGenerator);
- };
- }
- #endif
|