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 extern const size_t kBlockSize;
27 extern const size_t kRootFSPartitionSize;
28 
29 // The |config| describes the payload generation request, describing both
30 // old and new images for delta payloads and only the new image for full
31 // payloads.
32 // For delta payloads, the images should be already mounted read-only at
33 // the respective rootfs_mountpt.
34 // |private_key_path| points to a private key used to sign the update.
35 // Pass empty string to not sign the update.
36 // |output_path| is the filename where the delta update should be written.
37 // Returns true on success. Also writes the size of the metadata into
38 // |metadata_size|.
39 bool GenerateUpdatePayloadFile(const PayloadGenerationConfig& config,
40                                const std::string& output_path,
41                                const std::string& private_key_path,
42                                uint64_t* metadata_size);
43 
44 
45 };  // namespace chromeos_update_engine
46 
47 #endif  // UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_
48