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