Bob Badour | 8eb43ae | 2021-02-12 14:24:10 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 5 | cc_defaults { |
| 6 | name: "vold_default_flags", |
| 7 | |
| 8 | cflags: [ |
| 9 | "-Wall", |
| 10 | "-Werror", |
| 11 | "-Wextra", |
| 12 | "-Wno-missing-field-initializers", |
| 13 | "-Wno-unused-parameter", |
| 14 | "-Wno-unused-variable", |
| 15 | ], |
| 16 | |
| 17 | clang: true, |
| 18 | |
| 19 | tidy: true, |
| 20 | tidy_checks: [ |
| 21 | "-*", |
| 22 | "cert-*", |
| 23 | "clang-analyzer-security*", |
Nick Kralevich | d78fb53 | 2019-03-29 16:07:58 -0700 | [diff] [blame] | 24 | "android-*", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 25 | ], |
| 26 | tidy_flags: [ |
| 27 | "-warnings-as-errors=clang-analyzer-security*,cert-*", |
| 28 | ], |
| 29 | } |
| 30 | |
| 31 | cc_defaults { |
| 32 | name: "vold_default_libs", |
| 33 | |
| 34 | static_libs: [ |
Narayan Kamath | 02efdf5 | 2019-11-27 10:53:51 +0000 | [diff] [blame] | 35 | "libasync_safe", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 36 | "libavb", |
| 37 | "libbootloader_message", |
David Anderson | b922473 | 2019-05-13 13:02:54 -0700 | [diff] [blame] | 38 | "libdm", |
David Anderson | 10de69d | 2019-06-27 13:40:09 -0700 | [diff] [blame] | 39 | "libext2_uuid", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 40 | "libfec", |
| 41 | "libfec_rs", |
Bowgo Tsai | 549fd0e | 2018-11-29 22:15:08 +0800 | [diff] [blame] | 42 | "libfs_avb", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 43 | "libfs_mgr", |
| 44 | "libscrypt_static", |
| 45 | "libsquashfs_utils", |
| 46 | "libvold_binder", |
| 47 | ], |
| 48 | shared_libs: [ |
Daniel Rosenberg | d399249 | 2018-10-02 17:40:44 -0700 | [diff] [blame] | 49 | "android.hardware.boot@1.0", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 50 | "libbase", |
| 51 | "libbinder", |
| 52 | "libcrypto", |
| 53 | "libcrypto_utils", |
| 54 | "libcutils", |
| 55 | "libdiskconfig", |
| 56 | "libext4_utils", |
| 57 | "libf2fs_sparseblock", |
Yo Chiang | 0af25a3 | 2020-10-07 14:20:00 +0800 | [diff] [blame] | 58 | "libgsi", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 59 | "libhardware", |
| 60 | "libhardware_legacy", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 61 | "libincfs", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 62 | "libhidlbase", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 63 | "libkeyutils", |
| 64 | "liblog", |
| 65 | "liblogwrap", |
| 66 | "libselinux", |
| 67 | "libsysutils", |
| 68 | "libutils", |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | cc_library_static { |
| 73 | name: "libvold_binder", |
| 74 | defaults: ["vold_default_flags"], |
| 75 | |
| 76 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 77 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 78 | ], |
| 79 | shared_libs: [ |
| 80 | "libbinder", |
| 81 | "libutils", |
| 82 | ], |
| 83 | aidl: { |
| 84 | local_include_dirs: ["binder"], |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 85 | include_dirs: [ |
| 86 | "frameworks/native/aidl/binder", |
Jiyong Park | 50c3ab6 | 2020-01-20 12:37:52 +0900 | [diff] [blame] | 87 | "frameworks/base/core/java", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 88 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 89 | export_aidl_headers: true, |
| 90 | }, |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 91 | whole_static_libs: [ |
Jeongik Cha | 8925324 | 2021-01-26 22:35:14 +0900 | [diff] [blame] | 92 | "libincremental_aidl-cpp", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 93 | ], |
Songchun Fan | f77beb5 | 2021-02-25 23:16:11 +0000 | [diff] [blame] | 94 | export_shared_lib_headers: [ |
| 95 | "libbinder", |
| 96 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 97 | } |
| 98 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 99 | cc_library_headers { |
| 100 | name: "libvold_headers", |
Tao Bao | b1bbc70 | 2019-10-01 23:31:17 -0700 | [diff] [blame] | 101 | recovery_available: true, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 102 | export_include_dirs: ["."], |
| 103 | } |
| 104 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 105 | // Static library factored out to support testing |
| 106 | cc_library_static { |
| 107 | name: "libvold", |
| 108 | defaults: [ |
| 109 | "vold_default_flags", |
| 110 | "vold_default_libs", |
| 111 | ], |
| 112 | |
| 113 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 114 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 115 | "Benchmark.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 116 | "Checkpoint.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 117 | "CryptoType.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 118 | "Devmapper.cpp", |
| 119 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 120 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 121 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 122 | "IdleMaint.cpp", |
| 123 | "KeyBuffer.cpp", |
| 124 | "KeyStorage.cpp", |
| 125 | "KeyUtil.cpp", |
| 126 | "Keymaster.cpp", |
| 127 | "Loop.cpp", |
| 128 | "MetadataCrypt.cpp", |
| 129 | "MoveStorage.cpp", |
| 130 | "NetlinkHandler.cpp", |
| 131 | "NetlinkManager.cpp", |
| 132 | "Process.cpp", |
| 133 | "ScryptParameters.cpp", |
| 134 | "Utils.cpp", |
| 135 | "VoldNativeService.cpp", |
Yurii Zubrytskyi | 131365a | 2020-03-24 23:49:02 -0700 | [diff] [blame] | 136 | "VoldNativeServiceValidation.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 137 | "VoldUtil.cpp", |
| 138 | "VolumeManager.cpp", |
| 139 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 140 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 141 | "fs/Ext4.cpp", |
| 142 | "fs/F2fs.cpp", |
| 143 | "fs/Vfat.cpp", |
| 144 | "model/Disk.cpp", |
| 145 | "model/EmulatedVolume.cpp", |
| 146 | "model/ObbVolume.cpp", |
| 147 | "model/PrivateVolume.cpp", |
| 148 | "model/PublicVolume.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 149 | "model/StubVolume.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 150 | "model/VolumeBase.cpp", |
Paul Crowley | 886e572 | 2020-02-07 12:51:56 -0800 | [diff] [blame] | 151 | "model/VolumeEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 152 | ], |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 153 | product_variables: { |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 154 | arc: { |
| 155 | exclude_srcs: [ |
| 156 | "model/StubVolume.cpp", |
| 157 | ], |
| 158 | static_libs: [ |
| 159 | "libarcvolume", |
| 160 | ], |
| 161 | }, |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 162 | debuggable: { |
| 163 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 164 | }, |
| 165 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 166 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 167 | "android.hardware.health.storage@1.0", |
Jeongik Cha | 8925324 | 2021-01-26 22:35:14 +0900 | [diff] [blame] | 168 | "android.hardware.health.storage-V1-ndk_platform", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 169 | "android.system.keystore2-V1-ndk_platform", |
| 170 | "android.security.maintenance-ndk_platform", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 171 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 172 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 173 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 174 | whole_static_libs: [ |
| 175 | "com.android.sysprop.apex", |
Martijn Coenen | 816f4d9 | 2020-02-18 15:06:37 +0100 | [diff] [blame] | 176 | "libc++fs" |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 177 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | cc_binary { |
| 181 | name: "vold", |
| 182 | defaults: [ |
| 183 | "vold_default_flags", |
| 184 | "vold_default_libs", |
| 185 | ], |
| 186 | |
| 187 | srcs: ["main.cpp"], |
| 188 | static_libs: ["libvold"], |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 189 | init_rc: [ |
| 190 | "vold.rc", |
| 191 | "wait_for_keymaster.rc", |
| 192 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 193 | |
| 194 | required: [ |
| 195 | "mke2fs", |
| 196 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 197 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 198 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 199 | |
| 200 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 201 | "android.hardware.health.storage@1.0", |
Jeongik Cha | 8925324 | 2021-01-26 22:35:14 +0900 | [diff] [blame] | 202 | "android.hardware.health.storage-V1-ndk_platform", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 203 | "android.system.keystore2-V1-ndk_platform", |
| 204 | "android.security.maintenance-ndk_platform", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 205 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 206 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 207 | ], |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 208 | |
| 209 | product_variables: { |
| 210 | arc: { |
| 211 | exclude_srcs: [ |
| 212 | "model/StubVolume.cpp", |
| 213 | ], |
| 214 | static_libs: [ |
| 215 | "libarcvolume", |
| 216 | ], |
| 217 | }, |
| 218 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | cc_binary { |
| 222 | name: "vdc", |
| 223 | defaults: ["vold_default_flags"], |
| 224 | |
| 225 | srcs: ["vdc.cpp"], |
| 226 | shared_libs: [ |
| 227 | "libbase", |
| 228 | "libbinder", |
| 229 | "libcutils", |
| 230 | "libutils", |
| 231 | ], |
| 232 | static_libs: [ |
| 233 | "libvold_binder", |
| 234 | ], |
| 235 | init_rc: ["vdc.rc"], |
| 236 | } |
| 237 | |
| 238 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 239 | name: "wait_for_keymaster", |
| 240 | defaults: ["vold_default_flags"], |
| 241 | |
| 242 | srcs: [ |
| 243 | "wait_for_keymaster.cpp", |
| 244 | "Keymaster.cpp", |
| 245 | ], |
| 246 | shared_libs: [ |
| 247 | "libbase", |
| 248 | "libbinder", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 249 | "libbinder_ndk", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 250 | |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 251 | "android.system.keystore2-V1-ndk_platform", |
| 252 | "android.security.maintenance-ndk_platform", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 253 | "libhardware", |
| 254 | "libhardware_legacy", |
| 255 | "libhidlbase", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame^] | 256 | "libkeymint_support", |
Janis Danisevskis | 1e782f0 | 2019-06-12 13:27:20 -0700 | [diff] [blame] | 257 | "libutils", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 258 | ], |
| 259 | } |
| 260 | |
| 261 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 262 | name: "secdiscard", |
| 263 | defaults: ["vold_default_flags"], |
| 264 | |
| 265 | srcs: [ |
| 266 | "FileDeviceUtils.cpp", |
| 267 | "secdiscard.cpp", |
| 268 | ], |
| 269 | shared_libs: ["libbase"], |
| 270 | } |
| 271 | |
| 272 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 273 | name: "vold_prepare_subdirs", |
| 274 | defaults: ["vold_default_flags"], |
| 275 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 276 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 277 | shared_libs: [ |
| 278 | "libbase", |
| 279 | "libcutils", |
| 280 | "liblogwrap", |
| 281 | "libselinux", |
| 282 | "libutils", |
| 283 | ], |
| 284 | static_libs: [ |
| 285 | "libvold_binder", |
| 286 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 287 | } |
| 288 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 289 | filegroup { |
| 290 | name: "vold_aidl", |
| 291 | srcs: [ |
| 292 | "binder/android/os/IVold.aidl", |
| 293 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 294 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 295 | "binder/android/os/IVoldTaskListener.aidl", |
| 296 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 297 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 298 | } |