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", |
Eric Biggers | d86a8ab | 2021-06-15 11:34:00 -0700 | [diff] [blame] | 126 | "Keystore.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 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", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 168 | "android.hardware.health.storage-V1-ndk", |
| 169 | "android.system.keystore2-V1-ndk", |
| 170 | "android.security.maintenance-ndk", |
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", |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 191 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 192 | |
| 193 | required: [ |
| 194 | "mke2fs", |
| 195 | "vold_prepare_subdirs", |
| 196 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 197 | |
| 198 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 199 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 200 | "android.hardware.health.storage-V1-ndk", |
| 201 | "android.system.keystore2-V1-ndk", |
| 202 | "android.security.maintenance-ndk", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 203 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame] | 204 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 205 | ], |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 206 | |
| 207 | product_variables: { |
| 208 | arc: { |
| 209 | exclude_srcs: [ |
| 210 | "model/StubVolume.cpp", |
| 211 | ], |
| 212 | static_libs: [ |
| 213 | "libarcvolume", |
| 214 | ], |
| 215 | }, |
| 216 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | cc_binary { |
| 220 | name: "vdc", |
| 221 | defaults: ["vold_default_flags"], |
| 222 | |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 223 | srcs: [ |
| 224 | "vdc.cpp", |
| 225 | "Utils.cpp", |
| 226 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 227 | shared_libs: [ |
| 228 | "libbase", |
| 229 | "libbinder", |
| 230 | "libcutils", |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 231 | "liblogwrap", |
| 232 | "libselinux", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 233 | "libutils", |
| 234 | ], |
| 235 | static_libs: [ |
| 236 | "libvold_binder", |
| 237 | ], |
| 238 | init_rc: ["vdc.rc"], |
| 239 | } |
| 240 | |
| 241 | cc_binary { |
| 242 | name: "secdiscard", |
| 243 | defaults: ["vold_default_flags"], |
| 244 | |
| 245 | srcs: [ |
| 246 | "FileDeviceUtils.cpp", |
| 247 | "secdiscard.cpp", |
| 248 | ], |
| 249 | shared_libs: ["libbase"], |
| 250 | } |
| 251 | |
| 252 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 253 | name: "vold_prepare_subdirs", |
| 254 | defaults: ["vold_default_flags"], |
| 255 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 256 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 257 | shared_libs: [ |
| 258 | "libbase", |
| 259 | "libcutils", |
| 260 | "liblogwrap", |
| 261 | "libselinux", |
| 262 | "libutils", |
| 263 | ], |
| 264 | static_libs: [ |
| 265 | "libvold_binder", |
| 266 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 267 | } |
| 268 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 269 | filegroup { |
| 270 | name: "vold_aidl", |
| 271 | srcs: [ |
| 272 | "binder/android/os/IVold.aidl", |
| 273 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 274 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 275 | "binder/android/os/IVoldTaskListener.aidl", |
| 276 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 277 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 278 | } |