1cc_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*", 20 ], 21 tidy_flags: [ 22 "-warnings-as-errors=clang-analyzer-security*,cert-*", 23 ], 24} 25 26cc_defaults { 27 name: "vold_default_libs", 28 29 static_libs: [ 30 "libavb", 31 "libbootloader_message", 32 "libfec", 33 "libfec_rs", 34 "libfs_mgr", 35 "libscrypt_static", 36 "libsquashfs_utils", 37 "libvold_binder", 38 ], 39 shared_libs: [ 40 "android.hardware.keymaster@3.0", 41 "android.hardware.keymaster@4.0", 42 "libbase", 43 "libbinder", 44 "libcrypto", 45 "libcrypto_utils", 46 "libcutils", 47 "libdiskconfig", 48 "libext4_utils", 49 "libf2fs_sparseblock", 50 "libhardware", 51 "libhardware_legacy", 52 "libhidlbase", 53 "libhwbinder", 54 "libkeymaster4support", 55 "libkeyutils", 56 "liblog", 57 "liblogwrap", 58 "libselinux", 59 "libsysutils", 60 "libutils", 61 ], 62} 63 64cc_library_static { 65 name: "libvold_binder", 66 defaults: ["vold_default_flags"], 67 68 srcs: [ 69 ":vold_aidl", 70 ], 71 shared_libs: [ 72 "libbinder", 73 "libutils", 74 ], 75 aidl: { 76 local_include_dirs: ["binder"], 77 include_dirs: ["frameworks/native/aidl/binder"], 78 export_aidl_headers: true, 79 }, 80} 81 82cc_library_headers { 83 name: "libvold_headers", 84 export_include_dirs: ["."], 85} 86 87// Static library factored out to support testing 88cc_library_static { 89 name: "libvold", 90 defaults: [ 91 "vold_default_flags", 92 "vold_default_libs", 93 ], 94 95 srcs: [ 96 "Benchmark.cpp", 97 "CheckEncryption.cpp", 98 "Devmapper.cpp", 99 "EncryptInplace.cpp", 100 "Ext4Crypt.cpp", 101 "FileDeviceUtils.cpp", 102 "IdleMaint.cpp", 103 "KeyBuffer.cpp", 104 "KeyStorage.cpp", 105 "KeyUtil.cpp", 106 "Keymaster.cpp", 107 "Loop.cpp", 108 "MetadataCrypt.cpp", 109 "MoveStorage.cpp", 110 "NetlinkHandler.cpp", 111 "NetlinkManager.cpp", 112 "Process.cpp", 113 "ScryptParameters.cpp", 114 "Utils.cpp", 115 "VoldNativeService.cpp", 116 "VoldUtil.cpp", 117 "VolumeManager.cpp", 118 "cryptfs.cpp", 119 "fs/Exfat.cpp", 120 "fs/Ext4.cpp", 121 "fs/F2fs.cpp", 122 "fs/Vfat.cpp", 123 "model/Disk.cpp", 124 "model/EmulatedVolume.cpp", 125 "model/ObbVolume.cpp", 126 "model/PrivateVolume.cpp", 127 "model/PublicVolume.cpp", 128 "model/VolumeBase.cpp", 129 "secontext.cpp", 130 ], 131 product_variables: { 132 arc: { 133 exclude_srcs: [ 134 "model/ObbVolume.cpp", 135 ], 136 static_libs: [ 137 "arc_services_aidl", 138 "libarcobbvolume", 139 ], 140 }, 141 }, 142} 143 144cc_binary { 145 name: "vold", 146 defaults: [ 147 "vold_default_flags", 148 "vold_default_libs", 149 ], 150 151 srcs: ["main.cpp"], 152 static_libs: ["libvold"], 153 product_variables: { 154 arc: { 155 static_libs: [ 156 "arc_services_aidl", 157 "libarcobbvolume", 158 ], 159 }, 160 }, 161 init_rc: [ 162 "vold.rc", 163 "wait_for_keymaster.rc", 164 ], 165 166 required: [ 167 "mke2fs", 168 "vold_prepare_subdirs", 169 "wait_for_keymaster", 170 ], 171} 172 173cc_binary { 174 name: "vdc", 175 defaults: ["vold_default_flags"], 176 177 srcs: ["vdc.cpp"], 178 shared_libs: [ 179 "libbase", 180 "libbinder", 181 "libcutils", 182 "libutils", 183 ], 184 static_libs: [ 185 "libvold_binder", 186 ], 187 init_rc: ["vdc.rc"], 188} 189 190cc_binary { 191 name: "wait_for_keymaster", 192 defaults: ["vold_default_flags"], 193 194 srcs: [ 195 "wait_for_keymaster.cpp", 196 "Keymaster.cpp", 197 ], 198 shared_libs: [ 199 "libbase", 200 "libbinder", 201 202 "android.hardware.keymaster@3.0", 203 "android.hardware.keymaster@4.0", 204 "libhardware", 205 "libhardware_legacy", 206 "libhidlbase", 207 "libhwbinder", 208 "libkeymaster4support", 209 ], 210} 211 212cc_binary { 213 name: "secdiscard", 214 defaults: ["vold_default_flags"], 215 216 srcs: [ 217 "FileDeviceUtils.cpp", 218 "secdiscard.cpp", 219 ], 220 shared_libs: ["libbase"], 221} 222 223cc_binary { 224 name: "vold_prepare_subdirs", 225 defaults: ["vold_default_flags"], 226 227 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], 228 shared_libs: [ 229 "libbase", 230 "libcutils", 231 "liblogwrap", 232 "libselinux", 233 "libutils", 234 ], 235 static_libs: [ 236 "libvold_binder", 237 ], 238} 239 240filegroup { 241 name: "vold_aidl", 242 srcs: [ 243 "binder/android/os/IVold.aidl", 244 "binder/android/os/IVoldListener.aidl", 245 "binder/android/os/IVoldTaskListener.aidl", 246 ], 247} 248 249subdirs = ["tests"] 250