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