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: { |
| 152 | debuggable: { |
| 153 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 154 | }, |
| 155 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 156 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 157 | "android.hardware.health.storage@1.0", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame^] | 158 | "android.hardware.health.storage-unstable-ndk_platform", |
| 159 | "libbinder_ndk", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 160 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 161 | whole_static_libs: [ |
| 162 | "com.android.sysprop.apex", |
Martijn Coenen | 816f4d9 | 2020-02-18 15:06:37 +0100 | [diff] [blame] | 163 | "libc++fs" |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 164 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | cc_binary { |
| 168 | name: "vold", |
| 169 | defaults: [ |
| 170 | "vold_default_flags", |
| 171 | "vold_default_libs", |
| 172 | ], |
| 173 | |
| 174 | srcs: ["main.cpp"], |
| 175 | static_libs: ["libvold"], |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 176 | init_rc: [ |
| 177 | "vold.rc", |
| 178 | "wait_for_keymaster.rc", |
| 179 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 180 | |
| 181 | required: [ |
| 182 | "mke2fs", |
| 183 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 184 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 185 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 186 | |
| 187 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 188 | "android.hardware.health.storage@1.0", |
Yifan Hong | e1e4945 | 2021-01-13 17:27:42 -0800 | [diff] [blame^] | 189 | "android.hardware.health.storage-unstable-ndk_platform", |
| 190 | "libbinder_ndk", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 191 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | cc_binary { |
| 195 | name: "vdc", |
| 196 | defaults: ["vold_default_flags"], |
| 197 | |
| 198 | srcs: ["vdc.cpp"], |
| 199 | shared_libs: [ |
| 200 | "libbase", |
| 201 | "libbinder", |
| 202 | "libcutils", |
| 203 | "libutils", |
| 204 | ], |
| 205 | static_libs: [ |
| 206 | "libvold_binder", |
| 207 | ], |
| 208 | init_rc: ["vdc.rc"], |
| 209 | } |
| 210 | |
| 211 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 212 | name: "wait_for_keymaster", |
| 213 | defaults: ["vold_default_flags"], |
| 214 | |
| 215 | srcs: [ |
| 216 | "wait_for_keymaster.cpp", |
| 217 | "Keymaster.cpp", |
| 218 | ], |
| 219 | shared_libs: [ |
| 220 | "libbase", |
| 221 | "libbinder", |
| 222 | |
| 223 | "android.hardware.keymaster@3.0", |
| 224 | "android.hardware.keymaster@4.0", |
Shawn Willden | ae8f06f | 2020-01-16 13:21:42 -0700 | [diff] [blame] | 225 | "android.hardware.keymaster@4.1", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 226 | "libhardware", |
| 227 | "libhardware_legacy", |
| 228 | "libhidlbase", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 229 | "libkeymaster4support", |
Shawn Willden | ae8f06f | 2020-01-16 13:21:42 -0700 | [diff] [blame] | 230 | "libkeymaster4_1support", |
Janis Danisevskis | 1e782f0 | 2019-06-12 13:27:20 -0700 | [diff] [blame] | 231 | "libutils", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 232 | ], |
| 233 | } |
| 234 | |
| 235 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 236 | name: "secdiscard", |
| 237 | defaults: ["vold_default_flags"], |
| 238 | |
| 239 | srcs: [ |
| 240 | "FileDeviceUtils.cpp", |
| 241 | "secdiscard.cpp", |
| 242 | ], |
| 243 | shared_libs: ["libbase"], |
| 244 | } |
| 245 | |
| 246 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 247 | name: "vold_prepare_subdirs", |
| 248 | defaults: ["vold_default_flags"], |
| 249 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 250 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 251 | shared_libs: [ |
| 252 | "libbase", |
| 253 | "libcutils", |
| 254 | "liblogwrap", |
| 255 | "libselinux", |
| 256 | "libutils", |
| 257 | ], |
| 258 | static_libs: [ |
| 259 | "libvold_binder", |
| 260 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 261 | } |
| 262 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 263 | filegroup { |
| 264 | name: "vold_aidl", |
| 265 | srcs: [ |
| 266 | "binder/android/os/IVold.aidl", |
| 267 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 268 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 269 | "binder/android/os/IVoldTaskListener.aidl", |
| 270 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 271 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 272 | } |