Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -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 | cc_defaults { |
| 18 | name: "fs_mgr_defaults", |
| 19 | sanitize: { |
| 20 | misc_undefined: ["integer"], |
| 21 | }, |
| 22 | local_include_dirs: ["include/"], |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 23 | cflags: [ |
| 24 | "-Wall", |
| 25 | "-Werror", |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 26 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 27 | } |
| 28 | |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 29 | cc_defaults { |
| 30 | name: "libfs_mgr_defaults", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 31 | defaults: ["fs_mgr_defaults"], |
| 32 | export_include_dirs: ["include"], |
| 33 | include_dirs: ["system/vold"], |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 34 | cflags: [ |
| 35 | "-D_FILE_OFFSET_BITS=64", |
| 36 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 37 | srcs: [ |
David Anderson | c651213 | 2019-06-10 19:03:01 -0700 | [diff] [blame] | 38 | "file_wait.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 39 | "fs_mgr.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 40 | "fs_mgr_format.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 41 | "fs_mgr_verity.cpp", |
David Anderson | 62e5b20 | 2018-05-01 17:09:17 -0700 | [diff] [blame] | 42 | "fs_mgr_dm_linear.cpp", |
Mark Salyzyn | b28389f | 2018-06-06 13:10:40 -0700 | [diff] [blame] | 43 | "fs_mgr_overlayfs.cpp", |
Yifan Hong | bf80e7d | 2018-12-03 13:46:56 -0800 | [diff] [blame] | 44 | "fs_mgr_roots.cpp", |
Justin Yun | 6bab0a9 | 2018-10-29 18:31:48 +0900 | [diff] [blame] | 45 | "fs_mgr_vendor_overlay.cpp", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 46 | ":libfiemap_srcs", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 47 | ], |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 48 | shared_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 49 | "libbase", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 50 | "libcrypto", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 51 | "libcrypto_utils", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 52 | "libcutils", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 53 | "libext4_utils", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 54 | "libfec", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 55 | "liblog", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 56 | "liblp", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 57 | "libselinux", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 58 | ], |
| 59 | static_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 60 | "libavb", |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 61 | "libfs_avb", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 62 | "libfstab", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 63 | "libdm", |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 64 | "libgsi", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 65 | ], |
| 66 | export_static_lib_headers: [ |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 67 | "libfs_avb", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 68 | "libfstab", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 69 | "libdm", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 70 | ], |
| 71 | export_shared_lib_headers: [ |
David Anderson | ea3b8ac | 2018-06-07 15:36:09 -0700 | [diff] [blame] | 72 | "liblp", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 73 | ], |
| 74 | whole_static_libs: [ |
Jin Qian | 42d8137 | 2017-04-21 16:56:34 -0700 | [diff] [blame] | 75 | "liblogwrap", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 76 | "libdm", |
David Anderson | 924858c | 2019-06-26 17:00:00 -0700 | [diff] [blame] | 77 | "libext2_uuid", |
Paul Crowley | 7160fc1 | 2019-10-25 17:12:45 -0700 | [diff] [blame] | 78 | "libfscrypt", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 79 | "libfstab", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 80 | ], |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 81 | cppflags: [ |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 82 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 83 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 84 | product_variables: { |
| 85 | debuggable: { |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 86 | cppflags: [ |
| 87 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 88 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 89 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 90 | }, |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 91 | }, |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 92 | header_libs: [ |
| 93 | "libfiemap_headers", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame^] | 94 | "libstorage_literals_headers", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 95 | ], |
| 96 | export_header_lib_headers: [ |
| 97 | "libfiemap_headers", |
| 98 | ], |
| 99 | } |
| 100 | |
| 101 | // Two variants of libfs_mgr are provided: libfs_mgr and libfs_mgr_binder. |
| 102 | // Use libfs_mgr in recovery, first-stage-init, or when libfiemap or overlayfs |
| 103 | // is not used. |
| 104 | // |
| 105 | // Use libfs_mgr_binder when not in recovery/first-stage init, or when overlayfs |
| 106 | // or libfiemap is needed. In this case, libfiemap will proxy over binder to |
| 107 | // gsid. |
| 108 | cc_library { |
| 109 | // Do not ever allow this library to be vendor_available as a shared library. |
| 110 | // It does not have a stable interface. |
| 111 | name: "libfs_mgr", |
| 112 | recovery_available: true, |
| 113 | defaults: [ |
| 114 | "libfs_mgr_defaults", |
| 115 | ], |
| 116 | srcs: [ |
| 117 | ":libfiemap_passthrough_srcs", |
| 118 | ], |
| 119 | } |
| 120 | |
| 121 | cc_library { |
| 122 | // Do not ever allow this library to be vendor_available as a shared library. |
| 123 | // It does not have a stable interface. |
| 124 | name: "libfs_mgr_binder", |
| 125 | defaults: [ |
| 126 | "libfs_mgr_defaults", |
| 127 | "libfiemap_binder_defaults", |
| 128 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 129 | } |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 130 | |
| 131 | cc_library_static { |
Tom Cherry | 066fcdf | 2018-08-14 12:57:05 -0700 | [diff] [blame] | 132 | // Do not ever make this a shared library as long as it is vendor_available. |
| 133 | // It does not have a stable interface. |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 134 | name: "libfstab", |
| 135 | vendor_available: true, |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 136 | recovery_available: true, |
Bowgo Tsai | fa416f9 | 2019-01-07 15:30:27 +0800 | [diff] [blame] | 137 | host_supported: true, |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 138 | defaults: ["fs_mgr_defaults"], |
| 139 | srcs: [ |
| 140 | "fs_mgr_fstab.cpp", |
| 141 | "fs_mgr_boot_config.cpp", |
| 142 | "fs_mgr_slotselect.cpp", |
| 143 | ], |
bohu | 91c4bd7 | 2019-01-11 14:25:58 -0800 | [diff] [blame] | 144 | target: { |
| 145 | darwin: { |
| 146 | enabled: false, |
| 147 | }, |
| 148 | }, |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 149 | export_include_dirs: ["include_fstab"], |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 150 | header_libs: [ |
| 151 | "libbase_headers", |
| 152 | "libgsi_headers", |
| 153 | ], |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 154 | } |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 155 | |
| 156 | cc_binary { |
| 157 | name: "remount", |
| 158 | defaults: ["fs_mgr_defaults"], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 159 | static_libs: [ |
| 160 | "libavb_user", |
| 161 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 162 | shared_libs: [ |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 163 | "libbootloader_message", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 164 | "libbase", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 165 | "libcutils", |
Mark Salyzyn | 4469fb1 | 2019-01-30 10:19:15 -0800 | [diff] [blame] | 166 | "libcrypto", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 167 | "libext4_utils", |
Mark Salyzyn | 4469fb1 | 2019-01-30 10:19:15 -0800 | [diff] [blame] | 168 | "libfec", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame^] | 169 | "libfs_mgr_binder", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 170 | "liblog", |
| 171 | "liblp", |
| 172 | "libselinux", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 173 | ], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 174 | header_libs: [ |
| 175 | "libcutils_headers", |
| 176 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 177 | srcs: [ |
| 178 | "fs_mgr_remount.cpp", |
| 179 | ], |
| 180 | cppflags: [ |
| 181 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 182 | ], |
| 183 | product_variables: { |
| 184 | debuggable: { |
| 185 | cppflags: [ |
| 186 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 187 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 188 | ], |
| 189 | }, |
| 190 | }, |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame^] | 191 | required: [ |
| 192 | "clean_scratch_files", |
| 193 | ], |
| 194 | } |
| 195 | |
| 196 | cc_binary { |
| 197 | name: "clean_scratch_files", |
| 198 | defaults: ["fs_mgr_defaults"], |
| 199 | shared_libs: [ |
| 200 | "libbase", |
| 201 | "libfs_mgr_binder", |
| 202 | ], |
| 203 | srcs: [ |
| 204 | "clean_scratch_files.cpp", |
| 205 | ], |
| 206 | product_variables: { |
| 207 | debuggable: { |
| 208 | init_rc: [ |
| 209 | "clean_scratch_files.rc", |
| 210 | ], |
| 211 | }, |
| 212 | }, |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 213 | } |