// // Copyright (C) 2020 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include #include #include #include "common/libs/utils/result.h" #include "host/libs/avb/avb.h" namespace cuttlefish { // TODO(chadreynolds): rename MiscInfo to more generic KeyValueFile since this // logic is processing multiple filetypes now using MiscInfo = std::map; struct VbmetaArgs { std::string algorithm; std::string key_path; std::vector chained_partitions; std::vector included_partitions; std::vector extra_arguments; }; Result ParseMiscInfo(const std::string& file_contents); Result WriteMiscInfo(const MiscInfo& misc_info, const std::string& output_path); Result GetCombinedDynamicPartitions( const MiscInfo& vendor_info, const MiscInfo& system_info, const std::set& extracted_images); Result MergeMiscInfos( const MiscInfo& vendor_info, const MiscInfo& system_info, const MiscInfo& combined_dp_info, const std::vector& system_partitions); Result GetVbmetaArgs(const MiscInfo& misc_info, const std::string& image_path); } // namespace cuttlefish