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", |
| 57 | "libhardware", |
| 58 | "libhardware_legacy", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 59 | "libincfs", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 60 | "libhidlbase", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 61 | "libkeymaster4support", |
Shawn Willden | ae8f06f | 2020-01-16 13:21:42 -0700 | [diff] [blame] | 62 | "libkeymaster4_1support", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 63 | "libkeyutils", |
| 64 | "liblog", |
| 65 | "liblogwrap", |
| 66 | "libselinux", |
| 67 | "libsysutils", |
| 68 | "libutils", |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | cc_library_static { |
| 73 | name: "libvold_binder", |
| 74 | defaults: ["vold_default_flags"], |
| 75 | |
| 76 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 77 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 78 | ], |
| 79 | shared_libs: [ |
| 80 | "libbinder", |
| 81 | "libutils", |
| 82 | ], |
| 83 | aidl: { |
| 84 | local_include_dirs: ["binder"], |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 85 | include_dirs: [ |
| 86 | "frameworks/native/aidl/binder", |
Jiyong Park | 50c3ab6 | 2020-01-20 12:37:52 +0900 | [diff] [blame] | 87 | "frameworks/base/core/java", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 88 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 89 | export_aidl_headers: true, |
| 90 | }, |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 91 | whole_static_libs: [ |
| 92 | "libincremental_aidl-cpp", |
| 93 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 94 | } |
| 95 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 96 | cc_library_headers { |
| 97 | name: "libvold_headers", |
Tao Bao | b1bbc70 | 2019-10-01 23:31:17 -0700 | [diff] [blame] | 98 | recovery_available: true, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 99 | export_include_dirs: ["."], |
| 100 | } |
| 101 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 102 | // Static library factored out to support testing |
| 103 | cc_library_static { |
| 104 | name: "libvold", |
| 105 | defaults: [ |
| 106 | "vold_default_flags", |
| 107 | "vold_default_libs", |
| 108 | ], |
| 109 | |
| 110 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 111 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 112 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 113 | "CheckEncryption.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", |
| 134 | "VoldUtil.cpp", |
| 135 | "VolumeManager.cpp", |
| 136 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 137 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 138 | "fs/Ext4.cpp", |
| 139 | "fs/F2fs.cpp", |
| 140 | "fs/Vfat.cpp", |
| 141 | "model/Disk.cpp", |
| 142 | "model/EmulatedVolume.cpp", |
| 143 | "model/ObbVolume.cpp", |
| 144 | "model/PrivateVolume.cpp", |
| 145 | "model/PublicVolume.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 146 | "model/StubVolume.cpp", |
Paul Crowley | 220567c | 2020-02-07 12:45:20 -0800 | [diff] [blame] | 147 | "model/VolumeBase.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 148 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 149 | product_variables: { |
| 150 | arc: { |
| 151 | exclude_srcs: [ |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 152 | "AppFuseUtil.cpp", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 153 | "model/ObbVolume.cpp", |
| 154 | ], |
| 155 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 156 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 157 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 158 | "libarcobbvolume", |
| 159 | ], |
| 160 | }, |
Mark Salyzyn | c4405e9 | 2018-09-20 10:09:27 -0700 | [diff] [blame] | 161 | debuggable: { |
| 162 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 163 | }, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 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", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 167 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 168 | whole_static_libs: [ |
| 169 | "com.android.sysprop.apex", |
| 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", |
| 178 | ], |
| 179 | |
| 180 | srcs: ["main.cpp"], |
| 181 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 182 | product_variables: { |
| 183 | arc: { |
| 184 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 185 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 186 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 187 | "libarcobbvolume", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame] | 188 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 189 | }, |
| 190 | }, |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 191 | init_rc: [ |
| 192 | "vold.rc", |
| 193 | "wait_for_keymaster.rc", |
| 194 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 195 | |
| 196 | required: [ |
| 197 | "mke2fs", |
| 198 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 199 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 200 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 201 | |
| 202 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 203 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 204 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | cc_binary { |
| 208 | name: "vdc", |
| 209 | defaults: ["vold_default_flags"], |
| 210 | |
| 211 | srcs: ["vdc.cpp"], |
| 212 | shared_libs: [ |
| 213 | "libbase", |
| 214 | "libbinder", |
| 215 | "libcutils", |
| 216 | "libutils", |
| 217 | ], |
| 218 | static_libs: [ |
| 219 | "libvold_binder", |
| 220 | ], |
| 221 | init_rc: ["vdc.rc"], |
| 222 | } |
| 223 | |
| 224 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 225 | name: "wait_for_keymaster", |
| 226 | defaults: ["vold_default_flags"], |
| 227 | |
| 228 | srcs: [ |
| 229 | "wait_for_keymaster.cpp", |
| 230 | "Keymaster.cpp", |
| 231 | ], |
| 232 | shared_libs: [ |
| 233 | "libbase", |
| 234 | "libbinder", |
| 235 | |
| 236 | "android.hardware.keymaster@3.0", |
| 237 | "android.hardware.keymaster@4.0", |
Shawn Willden | ae8f06f | 2020-01-16 13:21:42 -0700 | [diff] [blame] | 238 | "android.hardware.keymaster@4.1", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 239 | "libhardware", |
| 240 | "libhardware_legacy", |
| 241 | "libhidlbase", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 242 | "libkeymaster4support", |
Shawn Willden | ae8f06f | 2020-01-16 13:21:42 -0700 | [diff] [blame] | 243 | "libkeymaster4_1support", |
Janis Danisevskis | 1e782f0 | 2019-06-12 13:27:20 -0700 | [diff] [blame] | 244 | "libutils", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 245 | ], |
| 246 | } |
| 247 | |
| 248 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 249 | name: "secdiscard", |
| 250 | defaults: ["vold_default_flags"], |
| 251 | |
| 252 | srcs: [ |
| 253 | "FileDeviceUtils.cpp", |
| 254 | "secdiscard.cpp", |
| 255 | ], |
| 256 | shared_libs: ["libbase"], |
| 257 | } |
| 258 | |
| 259 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 260 | name: "vold_prepare_subdirs", |
| 261 | defaults: ["vold_default_flags"], |
| 262 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 263 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 264 | shared_libs: [ |
| 265 | "libbase", |
| 266 | "libcutils", |
| 267 | "liblogwrap", |
| 268 | "libselinux", |
| 269 | "libutils", |
| 270 | ], |
| 271 | static_libs: [ |
| 272 | "libvold_binder", |
| 273 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 274 | } |
| 275 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 276 | filegroup { |
| 277 | name: "vold_aidl", |
| 278 | srcs: [ |
| 279 | "binder/android/os/IVold.aidl", |
| 280 | "binder/android/os/IVoldListener.aidl", |
Zim | 5048b4b | 2019-11-19 09:16:03 +0000 | [diff] [blame] | 281 | "binder/android/os/IVoldMountCallback.aidl", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 282 | "binder/android/os/IVoldTaskListener.aidl", |
| 283 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 284 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 285 | } |