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