1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3} 4 5cc_defaults { 6 name: "vold_default_flags", 7 8 cflags: [ 9 "-Wall", 10 "-Werror", 11 "-Wextra", 12 "-Wno-unused-parameter", 13 ], 14 15 tidy: true, 16 tidy_checks: [ 17 "-*", 18 "cert-*", 19 "clang-analyzer-security*", 20 "android-*", 21 ], 22 tidy_flags: [ 23 "-warnings-as-errors=clang-analyzer-security*,cert-*", 24 ], 25} 26 27cc_defaults { 28 name: "vold_default_libs", 29 30 static_libs: [ 31 "libasync_safe", 32 "libavb", 33 "libbootloader_message", 34 "libdm", 35 "libext2_uuid", 36 "libfec", 37 "libfec_rs", 38 "libfs_avb", 39 "libfs_mgr", 40 "libsquashfs_utils", 41 "libvold_binder", 42 ], 43 shared_libs: [ 44 "android.hardware.boot@1.0", 45 "libbase", 46 "libbinder", 47 "libcrypto", 48 "libcrypto_utils", 49 "libcutils", 50 "libdiskconfig", 51 "libext4_utils", 52 "libf2fs_sparseblock", 53 "libgsi", 54 "libhardware", 55 "libhardware_legacy", 56 "libincfs", 57 "libhidlbase", 58 "libkeyutils", 59 "liblog", 60 "liblogwrap", 61 "libselinux", 62 "libsysutils", 63 "libutils", 64 ], 65} 66 67cc_library_static { 68 name: "libvold_binder", 69 defaults: ["vold_default_flags"], 70 71 srcs: [ 72 ":vold_aidl", 73 ], 74 shared_libs: [ 75 "libbinder", 76 "libutils", 77 ], 78 aidl: { 79 local_include_dirs: ["binder"], 80 include_dirs: [ 81 "frameworks/native/aidl/binder", 82 "frameworks/base/core/java", 83 ], 84 export_aidl_headers: true, 85 }, 86 whole_static_libs: [ 87 "libincremental_aidl-cpp", 88 ], 89 export_shared_lib_headers: [ 90 "libbinder", 91 ], 92} 93 94cc_library_headers { 95 name: "libvold_headers", 96 recovery_available: true, 97 export_include_dirs: ["."], 98} 99 100// Static library factored out to support testing 101cc_library_static { 102 name: "libvold", 103 defaults: [ 104 "vold_default_flags", 105 "vold_default_libs", 106 "keystore2_use_latest_aidl_ndk_shared", 107 ], 108 109 srcs: [ 110 "AppFuseUtil.cpp", 111 "Benchmark.cpp", 112 "Checkpoint.cpp", 113 "CryptoType.cpp", 114 "EncryptInplace.cpp", 115 "FileDeviceUtils.cpp", 116 "FsCrypt.cpp", 117 "IdleMaint.cpp", 118 "KeyBuffer.cpp", 119 "KeyStorage.cpp", 120 "KeyUtil.cpp", 121 "Keystore.cpp", 122 "Loop.cpp", 123 "MetadataCrypt.cpp", 124 "MoveStorage.cpp", 125 "NetlinkHandler.cpp", 126 "NetlinkManager.cpp", 127 "Process.cpp", 128 "Utils.cpp", 129 "VoldNativeService.cpp", 130 "VoldNativeServiceValidation.cpp", 131 "VoldUtil.cpp", 132 "VolumeManager.cpp", 133 "cryptfs.cpp", 134 "fs/Exfat.cpp", 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", 143 "model/StubVolume.cpp", 144 "model/VolumeBase.cpp", 145 "model/VolumeEncryption.cpp", 146 ], 147 product_variables: { 148 arc: { 149 exclude_srcs: [ 150 "model/StubVolume.cpp", 151 ], 152 static_libs: [ 153 "libarcvolume", 154 ], 155 }, 156 debuggable: { 157 cppflags: ["-D__ANDROID_DEBUGGABLE__"], 158 }, 159 }, 160 shared_libs: [ 161 "android.hardware.health.storage@1.0", 162 "android.hardware.health.storage-V1-ndk", 163 "android.security.maintenance-ndk", 164 "libbinder_ndk", 165 "libkeymint_support", 166 ], 167 whole_static_libs: [ 168 "com.android.sysprop.apex", 169 "libc++fs", 170 ], 171} 172 173cc_binary { 174 name: "vold", 175 defaults: [ 176 "vold_default_flags", 177 "vold_default_libs", 178 "keystore2_use_latest_aidl_ndk_shared", 179 ], 180 181 srcs: ["main.cpp"], 182 static_libs: ["libvold"], 183 init_rc: [ 184 "vold.rc", 185 ], 186 187 required: [ 188 "mke2fs", 189 "vold_prepare_subdirs", 190 "fuse_media.o", 191 ], 192 193 shared_libs: [ 194 "android.hardware.health.storage@1.0", 195 "android.hardware.health.storage-V1-ndk", 196 "android.security.maintenance-ndk", 197 "libbinder_ndk", 198 "libkeymint_support", 199 ], 200 201 product_variables: { 202 arc: { 203 exclude_srcs: [ 204 "model/StubVolume.cpp", 205 ], 206 static_libs: [ 207 "libarcvolume", 208 ], 209 }, 210 }, 211} 212 213cc_binary { 214 name: "vdc", 215 defaults: ["vold_default_flags"], 216 217 srcs: [ 218 "vdc.cpp", 219 "Utils.cpp", 220 ], 221 shared_libs: [ 222 "libbase", 223 "libbinder", 224 "libcutils", 225 "liblogwrap", 226 "libselinux", 227 "libutils", 228 ], 229 static_libs: [ 230 "libvold_binder", 231 ], 232} 233 234cc_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 245cc_binary { 246 name: "vold_prepare_subdirs", 247 defaults: ["vold_default_flags"], 248 249 srcs: [ 250 "vold_prepare_subdirs.cpp", 251 "Utils.cpp", 252 ], 253 shared_libs: [ 254 "libbase", 255 "libcutils", 256 "liblogwrap", 257 "libselinux", 258 "libutils", 259 ], 260 static_libs: [ 261 "libvold_binder", 262 ], 263} 264 265filegroup { 266 name: "vold_aidl", 267 srcs: [ 268 "binder/android/os/IVold.aidl", 269 "binder/android/os/IVoldListener.aidl", 270 "binder/android/os/IVoldMountCallback.aidl", 271 "binder/android/os/IVoldTaskListener.aidl", 272 ], 273 path: "binder", 274} 275