1 // 2 // Copyright (C) 2023 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 #pragma once 17 18 #include <string> 19 20 #include "common/libs/utils/result.h" 21 22 namespace cuttlefish { 23 24 bool SplitRamdiskModules(const std::string& ramdisk_path, 25 const std::string& ramdisk_stage_dir, 26 const std::string& vendor_dlkm_build_dir, 27 const std::string& system_dlkm_build_dir); 28 29 Result<bool> WriteFsConfig(const char* output_path, const std::string& fs_root, 30 const std::string& mount_point); 31 32 Result<void> RepackSuperWithPartition(const std::string& superimg_path, 33 const std::string& image_path, 34 const std::string& partition_name); 35 36 Result<void> BuildVbmetaImage(const std::string& vendor_dlkm_img, 37 const std::string& vbmeta_path); 38 39 Result<void> BuildDlkmImage(const std::string& src_dir, const bool is_erofs, 40 const std::string& partition_name, 41 const std::string& output_image); 42 43 // Move file `src` to `dst` if the contents of these files differ. 44 // Return true if and only if the move happened. 45 bool MoveIfChanged(const std::string& src, const std::string& dst); 46 47 } // namespace cuttlefish 48