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", |
| 110 | ], |
| 111 | |
| 112 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 113 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 114 | "Benchmark.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 115 | "Checkpoint.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 116 | "CryptoType.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 117 | "Devmapper.cpp", |
| 118 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 119 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 120 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 121 | "IdleMaint.cpp", |
| 122 | "KeyBuffer.cpp", |
| 123 | "KeyStorage.cpp", |
| 124 | "KeyUtil.cpp", |
Eric Biggers | d86a8ab | 2021-06-15 11:34:00 -0700 | [diff] [blame] | 125 | "Keystore.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 126 | "Loop.cpp", |
| 127 | "MetadataCrypt.cpp", |
| 128 | "MoveStorage.cpp", |
| 129 | "NetlinkHandler.cpp", |
| 130 | "NetlinkManager.cpp", |
| 131 | "Process.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 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", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 166 | "android.hardware.health.storage-V1-ndk", |
| 167 | "android.system.keystore2-V1-ndk", |
| 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", |
| 183 | ], |
| 184 | |
| 185 | srcs: ["main.cpp"], |
| 186 | static_libs: ["libvold"], |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 187 | init_rc: [ |
| 188 | "vold.rc", |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 189 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 190 | |
| 191 | required: [ |
| 192 | "mke2fs", |
| 193 | "vold_prepare_subdirs", |
| 194 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 195 | |
| 196 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 197 | "android.hardware.health.storage@1.0", |
Jiyong Park | 973e059 | 2021-07-27 12:21:11 +0900 | [diff] [blame] | 198 | "android.hardware.health.storage-V1-ndk", |
| 199 | "android.system.keystore2-V1-ndk", |
| 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 | } |