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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 44 | "libsquashfs_utils", |
| 45 | "libvold_binder", |
| 46 | ], |
| 47 | shared_libs: [ |
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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 62 | "libkeyutils", |
| 63 | "liblog", |
| 64 | "liblogwrap", |
| 65 | "libselinux", |
| 66 | "libsysutils", |
| 67 | "libutils", |
| 68 | ], |
| 69 | } |
| 70 | |
| 71 | cc_library_static { |
| 72 | name: "libvold_binder", |
| 73 | defaults: ["vold_default_flags"], |
| 74 | |
| 75 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 76 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 77 | ], |
| 78 | shared_libs: [ |
| 79 | "libbinder", |
| 80 | "libutils", |
| 81 | ], |
| 82 | aidl: { |
| 83 | local_include_dirs: ["binder"], |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 84 | include_dirs: [ |
| 85 | "frameworks/native/aidl/binder", |
Jiyong Park | 50c3ab6 | 2020-01-20 12:37:52 +0900 | [diff] [blame] | 86 | "frameworks/base/core/java", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 87 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 88 | export_aidl_headers: true, |
| 89 | }, |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 90 | whole_static_libs: [ |
Jeongik Cha | 8925324 | 2021-01-26 22:35:14 +0900 | [diff] [blame] | 91 | "libincremental_aidl-cpp", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 92 | ], |
Songchun Fan | f77beb5 | 2021-02-25 23:16:11 +0000 | [diff] [blame] | 93 | export_shared_lib_headers: [ |
| 94 | "libbinder", |
| 95 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 96 | } |
| 97 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 98 | cc_library_headers { |
| 99 | name: "libvold_headers", |
Tao Bao | b1bbc70 | 2019-10-01 23:31:17 -0700 | [diff] [blame] | 100 | recovery_available: true, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 101 | export_include_dirs: ["."], |
| 102 | } |
| 103 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 104 | // Static library factored out to support testing |
| 105 | cc_library_static { |
| 106 | name: "libvold", |
| 107 | defaults: [ |
| 108 | "vold_default_flags", |
| 109 | "vold_default_libs", |
David Drysdale | 4babbc7 | 2021-11-22 18:19:40 +0000 | [diff] [blame^] | 110 | "keystore2_use_latest_aidl_ndk_shared", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 133 | "Utils.cpp", |
| 134 | "VoldNativeService.cpp", |
Yurii Zubrytskyi | 131365a | 2020-03-24 23:49:02 -0700 | [diff] [blame] | 135 | "VoldNativeServiceValidation.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 136 | "VoldUtil.cpp", |
| 137 | "VolumeManager.cpp", |
| 138 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 139 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 140 | "fs/Ext4.cpp", |
| 141 | "fs/F2fs.cpp", |
| 142 | "fs/Vfat.cpp", |
| 143 | "model/Disk.cpp", |
| 144 | "model/EmulatedVolume.cpp", |
| 145 | "model/ObbVolume.cpp", |
| 146 | "model/PrivateVolume.cpp", |
| 147 | "model/PublicVolume.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 148 | "model/StubVolume.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 149 | "model/VolumeBase.cpp", |
Paul Crowley | 886e572 | 2020-02-07 12:51:56 -0800 | [diff] [blame] | 150 | "model/VolumeEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 151 | ], |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 152 | product_variables: { |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 153 | arc: { |
| 154 | exclude_srcs: [ |
| 155 | "model/StubVolume.cpp", |
| 156 | ], |
| 157 | static_libs: [ |
| 158 | "libarcvolume", |
| 159 | ], |
| 160 | }, |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 161 | debuggable: { |
| 162 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 163 | }, |
| 164 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 165 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 166 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 167 | "android.hardware.health.storage-V1-ndk", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 168 | "android.security.maintenance-ndk", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 169 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame] | 170 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 171 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 172 | whole_static_libs: [ |
| 173 | "com.android.sysprop.apex", |
Martijn Coenen | 816f4d9 | 2020-02-18 15:06:37 +0100 | [diff] [blame] | 174 | "libc++fs" |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 175 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | cc_binary { |
| 179 | name: "vold", |
| 180 | defaults: [ |
| 181 | "vold_default_flags", |
| 182 | "vold_default_libs", |
David Drysdale | 4babbc7 | 2021-11-22 18:19:40 +0000 | [diff] [blame^] | 183 | "keystore2_use_latest_aidl_ndk_shared", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 184 | ], |
| 185 | |
| 186 | srcs: ["main.cpp"], |
| 187 | static_libs: ["libvold"], |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 188 | init_rc: [ |
| 189 | "vold.rc", |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 190 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 191 | |
| 192 | required: [ |
| 193 | "mke2fs", |
| 194 | "vold_prepare_subdirs", |
| 195 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 196 | |
| 197 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 198 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 199 | "android.hardware.health.storage-V1-ndk", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 200 | "android.security.maintenance-ndk", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 201 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame] | 202 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 203 | ], |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 204 | |
| 205 | product_variables: { |
| 206 | arc: { |
| 207 | exclude_srcs: [ |
| 208 | "model/StubVolume.cpp", |
| 209 | ], |
| 210 | static_libs: [ |
| 211 | "libarcvolume", |
| 212 | ], |
| 213 | }, |
| 214 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | cc_binary { |
| 218 | name: "vdc", |
| 219 | defaults: ["vold_default_flags"], |
| 220 | |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 221 | srcs: [ |
| 222 | "vdc.cpp", |
| 223 | "Utils.cpp", |
| 224 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 225 | shared_libs: [ |
| 226 | "libbase", |
| 227 | "libbinder", |
| 228 | "libcutils", |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 229 | "liblogwrap", |
| 230 | "libselinux", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 231 | "libutils", |
| 232 | ], |
| 233 | static_libs: [ |
| 234 | "libvold_binder", |
| 235 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | cc_binary { |
| 239 | name: "secdiscard", |
| 240 | defaults: ["vold_default_flags"], |
| 241 | |
| 242 | srcs: [ |
| 243 | "FileDeviceUtils.cpp", |
| 244 | "secdiscard.cpp", |
| 245 | ], |
| 246 | shared_libs: ["libbase"], |
| 247 | } |
| 248 | |
| 249 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 250 | name: "vold_prepare_subdirs", |
| 251 | defaults: ["vold_default_flags"], |
| 252 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 253 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 254 | shared_libs: [ |
| 255 | "libbase", |
| 256 | "libcutils", |
| 257 | "liblogwrap", |
| 258 | "libselinux", |
| 259 | "libutils", |
| 260 | ], |
| 261 | static_libs: [ |
| 262 | "libvold_binder", |
| 263 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 264 | } |
| 265 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 266 | filegroup { |
| 267 | name: "vold_aidl", |
| 268 | srcs: [ |
| 269 | "binder/android/os/IVold.aidl", |
| 270 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 271 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 272 | "binder/android/os/IVoldTaskListener.aidl", |
| 273 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 274 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 275 | } |