delta_diff_generator.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_
  17. #define UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_
  18. #include <string>
  19. #include "update_engine/payload_generator/payload_generation_config.h"
  20. namespace chromeos_update_engine {
  21. extern const size_t kBlockSize;
  22. extern const size_t kRootFSPartitionSize;
  23. // The |config| describes the payload generation request, describing both
  24. // old and new images for delta payloads and only the new image for full
  25. // payloads.
  26. // For delta payloads, the images should be already mounted read-only at
  27. // the respective rootfs_mountpt.
  28. // |private_key_path| points to a private key used to sign the update.
  29. // Pass empty string to not sign the update.
  30. // |output_path| is the filename where the delta update should be written.
  31. // Returns true on success. Also writes the size of the metadata into
  32. // |metadata_size|.
  33. bool GenerateUpdatePayloadFile(const PayloadGenerationConfig& config,
  34. const std::string& output_path,
  35. const std::string& private_key_path,
  36. uint64_t* metadata_size);
  37. }; // namespace chromeos_update_engine
  38. #endif // UPDATE_ENGINE_PAYLOAD_GENERATOR_DELTA_DIFF_GENERATOR_H_