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 | |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame^] | 17 | package { |
| 18 | default_applicable_licenses: ["system_core_fs_mgr_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // See: http://go/android-license-faq |
| 35 | license { |
| 36 | name: "system_core_fs_mgr_license", |
| 37 | visibility: [":__subpackages__"], |
| 38 | license_kinds: [ |
| 39 | "SPDX-license-identifier-Apache-2.0", |
| 40 | "SPDX-license-identifier-MIT", |
| 41 | ], |
| 42 | // large-scale-change unable to identify any license_text files |
| 43 | } |
| 44 | |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 45 | cc_defaults { |
| 46 | name: "fs_mgr_defaults", |
| 47 | sanitize: { |
| 48 | misc_undefined: ["integer"], |
| 49 | }, |
| 50 | local_include_dirs: ["include/"], |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 51 | cflags: [ |
| 52 | "-Wall", |
| 53 | "-Werror", |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 54 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 55 | } |
| 56 | |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 57 | cc_defaults { |
| 58 | name: "libfs_mgr_defaults", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 59 | defaults: ["fs_mgr_defaults"], |
| 60 | export_include_dirs: ["include"], |
| 61 | include_dirs: ["system/vold"], |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 62 | cflags: [ |
| 63 | "-D_FILE_OFFSET_BITS=64", |
| 64 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 65 | srcs: [ |
David Anderson | c651213 | 2019-06-10 19:03:01 -0700 | [diff] [blame] | 66 | "file_wait.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 67 | "fs_mgr.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 68 | "fs_mgr_format.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 69 | "fs_mgr_verity.cpp", |
David Anderson | 62e5b20 | 2018-05-01 17:09:17 -0700 | [diff] [blame] | 70 | "fs_mgr_dm_linear.cpp", |
Mark Salyzyn | b28389f | 2018-06-06 13:10:40 -0700 | [diff] [blame] | 71 | "fs_mgr_overlayfs.cpp", |
Yifan Hong | bf80e7d | 2018-12-03 13:46:56 -0800 | [diff] [blame] | 72 | "fs_mgr_roots.cpp", |
Justin Yun | 6bab0a9 | 2018-10-29 18:31:48 +0900 | [diff] [blame] | 73 | "fs_mgr_vendor_overlay.cpp", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 74 | ":libfiemap_srcs", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 75 | ], |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 76 | shared_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 77 | "libbase", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 78 | "libcrypto", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 79 | "libcrypto_utils", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 80 | "libcutils", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 81 | "libext4_utils", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 82 | "libfec", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 83 | "liblog", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 84 | "liblp", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 85 | "libselinux", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 86 | ], |
| 87 | static_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 88 | "libavb", |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 89 | "libfs_avb", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 90 | "libfstab", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 91 | "libdm", |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 92 | "libgsi", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 93 | ], |
| 94 | export_static_lib_headers: [ |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 95 | "libfs_avb", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 96 | "libfstab", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 97 | "libdm", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 98 | ], |
| 99 | export_shared_lib_headers: [ |
David Anderson | ea3b8ac | 2018-06-07 15:36:09 -0700 | [diff] [blame] | 100 | "liblp", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 101 | ], |
| 102 | whole_static_libs: [ |
Jin Qian | 42d8137 | 2017-04-21 16:56:34 -0700 | [diff] [blame] | 103 | "liblogwrap", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 104 | "libdm", |
David Anderson | 924858c | 2019-06-26 17:00:00 -0700 | [diff] [blame] | 105 | "libext2_uuid", |
Paul Crowley | 7160fc1 | 2019-10-25 17:12:45 -0700 | [diff] [blame] | 106 | "libfscrypt", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 107 | "libfstab", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 108 | ], |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 109 | cppflags: [ |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 110 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 111 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 112 | product_variables: { |
| 113 | debuggable: { |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 114 | cppflags: [ |
| 115 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 116 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 117 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 118 | }, |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 119 | }, |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 120 | header_libs: [ |
| 121 | "libfiemap_headers", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 122 | "libstorage_literals_headers", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 123 | ], |
| 124 | export_header_lib_headers: [ |
| 125 | "libfiemap_headers", |
| 126 | ], |
Alessio Balsini | 843820e | 2020-01-24 16:08:28 +0000 | [diff] [blame] | 127 | required: [ |
| 128 | "e2freefrag", |
| 129 | "e2fsdroid", |
| 130 | ], |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | // Two variants of libfs_mgr are provided: libfs_mgr and libfs_mgr_binder. |
| 134 | // Use libfs_mgr in recovery, first-stage-init, or when libfiemap or overlayfs |
| 135 | // is not used. |
| 136 | // |
| 137 | // Use libfs_mgr_binder when not in recovery/first-stage init, or when overlayfs |
| 138 | // or libfiemap is needed. In this case, libfiemap will proxy over binder to |
| 139 | // gsid. |
| 140 | cc_library { |
| 141 | // Do not ever allow this library to be vendor_available as a shared library. |
| 142 | // It does not have a stable interface. |
| 143 | name: "libfs_mgr", |
| 144 | recovery_available: true, |
| 145 | defaults: [ |
| 146 | "libfs_mgr_defaults", |
| 147 | ], |
| 148 | srcs: [ |
| 149 | ":libfiemap_passthrough_srcs", |
| 150 | ], |
| 151 | } |
| 152 | |
| 153 | cc_library { |
| 154 | // Do not ever allow this library to be vendor_available as a shared library. |
| 155 | // It does not have a stable interface. |
| 156 | name: "libfs_mgr_binder", |
| 157 | defaults: [ |
| 158 | "libfs_mgr_defaults", |
| 159 | "libfiemap_binder_defaults", |
| 160 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 161 | } |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 162 | |
| 163 | cc_library_static { |
Tom Cherry | 066fcdf | 2018-08-14 12:57:05 -0700 | [diff] [blame] | 164 | // Do not ever make this a shared library as long as it is vendor_available. |
| 165 | // It does not have a stable interface. |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 166 | name: "libfstab", |
| 167 | vendor_available: true, |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 168 | recovery_available: true, |
Bowgo Tsai | fa416f9 | 2019-01-07 15:30:27 +0800 | [diff] [blame] | 169 | host_supported: true, |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 170 | defaults: ["fs_mgr_defaults"], |
| 171 | srcs: [ |
| 172 | "fs_mgr_fstab.cpp", |
| 173 | "fs_mgr_boot_config.cpp", |
| 174 | "fs_mgr_slotselect.cpp", |
| 175 | ], |
bohu | 91c4bd7 | 2019-01-11 14:25:58 -0800 | [diff] [blame] | 176 | target: { |
| 177 | darwin: { |
| 178 | enabled: false, |
| 179 | }, |
Hung-ying Tyan | e7cb09d | 2020-07-03 14:26:59 +0800 | [diff] [blame] | 180 | vendor: { |
| 181 | cflags: [ |
| 182 | // Skipping entries in fstab should only be done in a system |
| 183 | // process as the config file is in /system_ext. |
| 184 | // Remove the op from the vendor variant. |
| 185 | "-DNO_SKIP_MOUNT", |
| 186 | ], |
| 187 | }, |
bohu | 91c4bd7 | 2019-01-11 14:25:58 -0800 | [diff] [blame] | 188 | }, |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 189 | export_include_dirs: ["include_fstab"], |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 190 | header_libs: [ |
| 191 | "libbase_headers", |
| 192 | "libgsi_headers", |
| 193 | ], |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 194 | } |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 195 | |
| 196 | cc_binary { |
| 197 | name: "remount", |
| 198 | defaults: ["fs_mgr_defaults"], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 199 | static_libs: [ |
| 200 | "libavb_user", |
Yo Chiang | d542910 | 2021-01-21 18:14:47 +0800 | [diff] [blame] | 201 | "libgsid", |
David Anderson | 8696a5d | 2020-06-10 23:50:02 -0700 | [diff] [blame] | 202 | "libutils", |
| 203 | "libvold_binder", |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 204 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 205 | shared_libs: [ |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 206 | "libbootloader_message", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 207 | "libbase", |
David Anderson | 8696a5d | 2020-06-10 23:50:02 -0700 | [diff] [blame] | 208 | "libbinder", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 209 | "libcutils", |
Mark Salyzyn | 4469fb1 | 2019-01-30 10:19:15 -0800 | [diff] [blame] | 210 | "libcrypto", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 211 | "libext4_utils", |
Mark Salyzyn | 4469fb1 | 2019-01-30 10:19:15 -0800 | [diff] [blame] | 212 | "libfec", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 213 | "libfs_mgr_binder", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 214 | "liblog", |
| 215 | "liblp", |
| 216 | "libselinux", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 217 | ], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 218 | header_libs: [ |
| 219 | "libcutils_headers", |
| 220 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 221 | srcs: [ |
| 222 | "fs_mgr_remount.cpp", |
| 223 | ], |
| 224 | cppflags: [ |
| 225 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 226 | ], |
| 227 | product_variables: { |
| 228 | debuggable: { |
| 229 | cppflags: [ |
| 230 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 231 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 232 | ], |
| 233 | }, |
| 234 | }, |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 235 | required: [ |
| 236 | "clean_scratch_files", |
| 237 | ], |
| 238 | } |
| 239 | |
| 240 | cc_binary { |
| 241 | name: "clean_scratch_files", |
| 242 | defaults: ["fs_mgr_defaults"], |
| 243 | shared_libs: [ |
| 244 | "libbase", |
| 245 | "libfs_mgr_binder", |
| 246 | ], |
| 247 | srcs: [ |
| 248 | "clean_scratch_files.cpp", |
| 249 | ], |
| 250 | product_variables: { |
| 251 | debuggable: { |
| 252 | init_rc: [ |
| 253 | "clean_scratch_files.rc", |
| 254 | ], |
| 255 | }, |
| 256 | }, |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 257 | } |