Amin Hassani | 924183b | 2017-09-27 14:50:59 -0700 | [diff] [blame^] | 1 | // |
| 2 | // Copyright (C) 2017 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_DEFLATE_UTILS_H_ |
| 18 | #define UPDATE_ENGINE_PAYLOAD_GENERATOR_DEFLATE_UTILS_H_ |
| 19 | |
| 20 | #include <vector> |
| 21 | |
| 22 | #include "update_engine/payload_generator/filesystem_interface.h" |
| 23 | #include "update_engine/payload_generator/payload_generation_config.h" |
| 24 | |
| 25 | namespace chromeos_update_engine { |
| 26 | namespace deflate_utils { |
| 27 | |
| 28 | // Spreads all extents in |over_extents| over |base_extents|. Here we assume the |
| 29 | // extents are non-overlapping. |
| 30 | // |
| 31 | // |base_extents|: |
| 32 | // | ----------------------- ------ -------------- |
| 33 | // |over_extents|: |
| 34 | // | ========== ==== ========== ====== |
| 35 | // |over_extents| is transforms to: |
| 36 | // | ========== ==== = ====== === ====== |
| 37 | // |
| 38 | bool ShiftExtentsOverExtents(const std::vector<Extent>& base_extents, |
| 39 | std::vector<Extent>* over_extents); |
| 40 | |
| 41 | // Gets the files from the partition and processes all its files. Processing |
| 42 | // includes: |
| 43 | // - splitting large Squashfs containers into its smaller files. |
| 44 | bool PreprocessParitionFiles(const PartitionConfig& part, |
| 45 | std::vector<FilesystemInterface::File>* result); |
| 46 | |
| 47 | } // namespace deflate_utils |
| 48 | } // namespace chromeos_update_engine |
| 49 | #endif // UPDATE_ENGINE_PAYLOAD_GENERATOR_DEFLATE_UTILS_H_ |