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 17 #pragma once 18 19 #include <functional> 20 #include <string> 21 22 #include <fstab/fstab.h> 23 24 // Do not include logging_macros.h here as this header is used by fs_mgr, too. 25 26 bool fs_mgr_get_boot_config(const std::string& key, std::string* out_val); 27 28 bool fs_mgr_update_for_slotselect(android::fs_mgr::Fstab* fstab); 29 bool is_dt_compatible(); 30 31 namespace android { 32 namespace fs_mgr { 33 34 bool InRecovery(); 35 bool ParseFstabFromString(const std::string& fstab_str, bool proc_mounts, Fstab* fstab_out); 36 bool SkipMountWithConfig(const std::string& skip_config, Fstab* fstab, bool verbose); 37 std::string GetFstabPath(); 38 39 void ImportBootconfigFromString(const std::string& bootconfig, 40 const std::function<void(std::string, std::string)>& fn); 41 42 bool GetBootconfigFromString(const std::string& bootconfig, const std::string& key, 43 std::string* out); 44 45 void ImportKernelCmdlineFromString(const std::string& cmdline, 46 const std::function<void(std::string, std::string)>& fn); 47 48 bool GetKernelCmdlineFromString(const std::string& cmdline, const std::string& key, 49 std::string* out); 50 51 } // namespace fs_mgr 52 } // namespace android 53