1 // 2 // Copyright (C) 2012 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 #ifndef UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_ 18 #define UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_ 19 20 #include <string> 21 22 #include "update_engine/payload_generator/payload_generation_config.h" 23 24 namespace chromeos_update_engine { 25 26 constexpr size_t kBlockSize = 4096; 27 28 extern const size_t kRootFSPartitionSize; 29 30 // The |config| describes the payload generation request, describing both 31 // old and new images for delta payloads and only the new image for full 32 // payloads. 33 // For delta payloads, the images should be already mounted read-only at 34 // the respective rootfs_mountpt. 35 // |private_key_path| points to a private key used to sign the update. 36 // Pass empty string to not sign the update. 37 // |output_path| is the filename where the delta update should be written. 38 // Returns true on success. Also writes the size of the metadata into 39 // |metadata_size|. 40 bool GenerateUpdatePayloadFile(const PayloadGenerationConfig& config, 41 const std::string& output_path, 42 const std::string& private_key_path, 43 uint64_t* metadata_size); 44 45 }; // namespace chromeos_update_engine 46 47 #endif // UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_ 48