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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 12 | "-Wno-unused-parameter", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 13 | ], |
| 14 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 40 | "libsquashfs_utils", |
| 41 | "libvold_binder", |
| 42 | ], |
| 43 | shared_libs: [ |
Daniel Rosenberg | d399249 | 2018-10-02 17:40:44 -0700 | [diff] [blame] | 44 | "android.hardware.boot@1.0", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 45 | "libbase", |
| 46 | "libbinder", |
| 47 | "libcrypto", |
| 48 | "libcrypto_utils", |
| 49 | "libcutils", |
| 50 | "libdiskconfig", |
| 51 | "libext4_utils", |
| 52 | "libf2fs_sparseblock", |
Yo Chiang | 0af25a3 | 2020-10-07 14:20:00 +0800 | [diff] [blame] | 53 | "libgsi", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 54 | "libhardware", |
| 55 | "libhardware_legacy", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 56 | "libincfs", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 57 | "libhidlbase", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 58 | "libkeyutils", |
| 59 | "liblog", |
| 60 | "liblogwrap", |
| 61 | "libselinux", |
| 62 | "libsysutils", |
| 63 | "libutils", |
| 64 | ], |
| 65 | } |
| 66 | |
| 67 | cc_library_static { |
| 68 | name: "libvold_binder", |
| 69 | defaults: ["vold_default_flags"], |
| 70 | |
| 71 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 72 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 73 | ], |
| 74 | shared_libs: [ |
| 75 | "libbinder", |
| 76 | "libutils", |
| 77 | ], |
| 78 | aidl: { |
| 79 | local_include_dirs: ["binder"], |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 80 | include_dirs: [ |
| 81 | "frameworks/native/aidl/binder", |
Jiyong Park | 50c3ab6 | 2020-01-20 12:37:52 +0900 | [diff] [blame] | 82 | "frameworks/base/core/java", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 83 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 84 | export_aidl_headers: true, |
| 85 | }, |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 86 | whole_static_libs: [ |
Jeongik Cha | 8925324 | 2021-01-26 22:35:14 +0900 | [diff] [blame] | 87 | "libincremental_aidl-cpp", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 88 | ], |
Songchun Fan | f77beb5 | 2021-02-25 23:16:11 +0000 | [diff] [blame] | 89 | export_shared_lib_headers: [ |
| 90 | "libbinder", |
| 91 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 92 | } |
| 93 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 94 | cc_library_headers { |
| 95 | name: "libvold_headers", |
Tao Bao | b1bbc70 | 2019-10-01 23:31:17 -0700 | [diff] [blame] | 96 | recovery_available: true, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 97 | export_include_dirs: ["."], |
| 98 | } |
| 99 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 100 | // Static library factored out to support testing |
| 101 | cc_library_static { |
| 102 | name: "libvold", |
| 103 | defaults: [ |
| 104 | "vold_default_flags", |
| 105 | "vold_default_libs", |
David Drysdale | 4babbc7 | 2021-11-22 18:19:40 +0000 | [diff] [blame] | 106 | "keystore2_use_latest_aidl_ndk_shared", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 107 | ], |
| 108 | |
| 109 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 110 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 111 | "Benchmark.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 112 | "Checkpoint.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 113 | "CryptoType.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 114 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 115 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 116 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 117 | "IdleMaint.cpp", |
| 118 | "KeyBuffer.cpp", |
| 119 | "KeyStorage.cpp", |
| 120 | "KeyUtil.cpp", |
Eric Biggers | d86a8ab | 2021-06-15 11:34:00 -0700 | [diff] [blame] | 121 | "Keystore.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 122 | "Loop.cpp", |
| 123 | "MetadataCrypt.cpp", |
| 124 | "MoveStorage.cpp", |
| 125 | "NetlinkHandler.cpp", |
| 126 | "NetlinkManager.cpp", |
| 127 | "Process.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 128 | "Utils.cpp", |
| 129 | "VoldNativeService.cpp", |
Yurii Zubrytskyi | 131365a | 2020-03-24 23:49:02 -0700 | [diff] [blame] | 130 | "VoldNativeServiceValidation.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 131 | "VoldUtil.cpp", |
| 132 | "VolumeManager.cpp", |
| 133 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 134 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 135 | "fs/Ext4.cpp", |
| 136 | "fs/F2fs.cpp", |
| 137 | "fs/Vfat.cpp", |
| 138 | "model/Disk.cpp", |
| 139 | "model/EmulatedVolume.cpp", |
| 140 | "model/ObbVolume.cpp", |
| 141 | "model/PrivateVolume.cpp", |
| 142 | "model/PublicVolume.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 143 | "model/StubVolume.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 144 | "model/VolumeBase.cpp", |
Paul Crowley | 886e572 | 2020-02-07 12:51:56 -0800 | [diff] [blame] | 145 | "model/VolumeEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 146 | ], |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 147 | product_variables: { |
Risan | 4ad2048 | 2021-01-20 05:53:15 +0000 | [diff] [blame] | 148 | arc: { |
| 149 | exclude_srcs: [ |
| 150 | "model/StubVolume.cpp", |
| 151 | ], |
| 152 | static_libs: [ |
| 153 | "libarcvolume", |
| 154 | ], |
| 155 | }, |
Mark Salyzyn | 865086d | 2020-07-17 08:17:50 -0700 | [diff] [blame] | 156 | debuggable: { |
| 157 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 158 | }, |
| 159 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 160 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 161 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 162 | "android.hardware.health.storage-V1-ndk", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 163 | "android.security.maintenance-ndk", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 164 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame] | 165 | "libkeymint_support", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 166 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 167 | whole_static_libs: [ |
| 168 | "com.android.sysprop.apex", |
Alix | 3477869 | 2022-04-18 04:00:10 +0000 | [diff] [blame] | 169 | "libc++fs", |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 170 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | cc_binary { |
| 174 | name: "vold", |
| 175 | defaults: [ |
| 176 | "vold_default_flags", |
| 177 | "vold_default_libs", |
David Drysdale | 4babbc7 | 2021-11-22 18:19:40 +0000 | [diff] [blame] | 178 | "keystore2_use_latest_aidl_ndk_shared", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 179 | ], |
| 180 | |
| 181 | srcs: ["main.cpp"], |
| 182 | static_libs: ["libvold"], |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 183 | init_rc: [ |
| 184 | "vold.rc", |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 185 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 186 | |
| 187 | required: [ |
| 188 | "mke2fs", |
| 189 | "vold_prepare_subdirs", |
Paul Lawrence | 5defbf9 | 2021-11-09 16:34:46 +0000 | [diff] [blame] | 190 | "fuse_media.o", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 191 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 192 | |
| 193 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 194 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 195 | "android.hardware.health.storage-V1-ndk", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 196 | "android.security.maintenance-ndk", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame] | 197 | "libbinder_ndk", |
Satya Tangirala | e8de4ff | 2021-02-28 22:32:07 -0800 | [diff] [blame] | 198 | "libkeymint_support", |
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 | }, |
Alix | 3477869 | 2022-04-18 04:00:10 +0000 | [diff] [blame] | 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 | |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 217 | srcs: [ |
| 218 | "vdc.cpp", |
| 219 | "Utils.cpp", |
| 220 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 221 | shared_libs: [ |
| 222 | "libbase", |
| 223 | "libbinder", |
| 224 | "libcutils", |
Sean Keys | 8452f41 | 2021-07-07 22:38:04 +0000 | [diff] [blame] | 225 | "liblogwrap", |
| 226 | "libselinux", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 227 | "libutils", |
| 228 | ], |
| 229 | static_libs: [ |
| 230 | "libvold_binder", |
| 231 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | cc_binary { |
| 235 | name: "secdiscard", |
| 236 | defaults: ["vold_default_flags"], |
| 237 | |
| 238 | srcs: [ |
| 239 | "FileDeviceUtils.cpp", |
| 240 | "secdiscard.cpp", |
| 241 | ], |
| 242 | shared_libs: ["libbase"], |
| 243 | } |
| 244 | |
| 245 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 246 | name: "vold_prepare_subdirs", |
| 247 | defaults: ["vold_default_flags"], |
| 248 | |
Alix | 3477869 | 2022-04-18 04:00:10 +0000 | [diff] [blame] | 249 | srcs: [ |
| 250 | "vold_prepare_subdirs.cpp", |
| 251 | "Utils.cpp", |
| 252 | ], |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 253 | shared_libs: [ |
| 254 | "libbase", |
| 255 | "libcutils", |
| 256 | "liblogwrap", |
| 257 | "libselinux", |
| 258 | "libutils", |
| 259 | ], |
| 260 | static_libs: [ |
| 261 | "libvold_binder", |
| 262 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 263 | } |
| 264 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 265 | filegroup { |
| 266 | name: "vold_aidl", |
| 267 | srcs: [ |
| 268 | "binder/android/os/IVold.aidl", |
| 269 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 270 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 271 | "binder/android/os/IVoldTaskListener.aidl", |
| 272 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 273 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 274 | } |