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*", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 20 | ], |
| 21 | tidy_flags: [ |
| 22 | "-warnings-as-errors=clang-analyzer-security*,cert-*", |
| 23 | ], |
| 24 | } |
| 25 | |
| 26 | cc_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", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 41 | "android.hardware.keymaster@4.0", |
Daniel Rosenberg | d399249 | 2018-10-02 17:40:44 -0700 | [diff] [blame] | 42 | "android.hardware.boot@1.0", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 43 | "libbase", |
| 44 | "libbinder", |
| 45 | "libcrypto", |
| 46 | "libcrypto_utils", |
| 47 | "libcutils", |
| 48 | "libdiskconfig", |
| 49 | "libext4_utils", |
| 50 | "libf2fs_sparseblock", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 51 | "libfscrypt", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 52 | "libhardware", |
| 53 | "libhardware_legacy", |
| 54 | "libhidlbase", |
| 55 | "libhwbinder", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 56 | "libkeymaster4support", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 57 | "libkeyutils", |
| 58 | "liblog", |
| 59 | "liblogwrap", |
| 60 | "libselinux", |
| 61 | "libsysutils", |
| 62 | "libutils", |
| 63 | ], |
| 64 | } |
| 65 | |
| 66 | cc_library_static { |
| 67 | name: "libvold_binder", |
| 68 | defaults: ["vold_default_flags"], |
| 69 | |
| 70 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 71 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 72 | ], |
| 73 | shared_libs: [ |
| 74 | "libbinder", |
| 75 | "libutils", |
| 76 | ], |
| 77 | aidl: { |
| 78 | local_include_dirs: ["binder"], |
| 79 | include_dirs: ["frameworks/native/aidl/binder"], |
| 80 | export_aidl_headers: true, |
| 81 | }, |
| 82 | } |
| 83 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 84 | cc_library_headers { |
| 85 | name: "libvold_headers", |
| 86 | export_include_dirs: ["."], |
| 87 | } |
| 88 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 89 | // Static library factored out to support testing |
| 90 | cc_library_static { |
| 91 | name: "libvold", |
| 92 | defaults: [ |
| 93 | "vold_default_flags", |
| 94 | "vold_default_libs", |
| 95 | ], |
| 96 | |
| 97 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 98 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 99 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 100 | "CheckEncryption.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 101 | "Checkpoint.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 102 | "Devmapper.cpp", |
| 103 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 104 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 105 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 106 | "IdleMaint.cpp", |
| 107 | "KeyBuffer.cpp", |
| 108 | "KeyStorage.cpp", |
| 109 | "KeyUtil.cpp", |
| 110 | "Keymaster.cpp", |
| 111 | "Loop.cpp", |
| 112 | "MetadataCrypt.cpp", |
| 113 | "MoveStorage.cpp", |
| 114 | "NetlinkHandler.cpp", |
| 115 | "NetlinkManager.cpp", |
| 116 | "Process.cpp", |
| 117 | "ScryptParameters.cpp", |
| 118 | "Utils.cpp", |
| 119 | "VoldNativeService.cpp", |
| 120 | "VoldUtil.cpp", |
| 121 | "VolumeManager.cpp", |
| 122 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 123 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 124 | "fs/Ext4.cpp", |
| 125 | "fs/F2fs.cpp", |
| 126 | "fs/Vfat.cpp", |
| 127 | "model/Disk.cpp", |
| 128 | "model/EmulatedVolume.cpp", |
| 129 | "model/ObbVolume.cpp", |
| 130 | "model/PrivateVolume.cpp", |
| 131 | "model/PublicVolume.cpp", |
| 132 | "model/VolumeBase.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 133 | "model/StubVolume.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 134 | "secontext.cpp", |
| 135 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 136 | product_variables: { |
| 137 | arc: { |
| 138 | exclude_srcs: [ |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame^] | 139 | "AppFuseUtil.cpp", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 140 | "model/ObbVolume.cpp", |
| 141 | ], |
| 142 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 143 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame^] | 144 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 145 | "libarcobbvolume", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame^] | 146 | "libparcelfiledescriptor", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 147 | ], |
| 148 | }, |
Mark Salyzyn | c4405e9 | 2018-09-20 10:09:27 -0700 | [diff] [blame] | 149 | debuggable: { |
| 150 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 151 | }, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 152 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 153 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 154 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 155 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | cc_binary { |
| 159 | name: "vold", |
| 160 | defaults: [ |
| 161 | "vold_default_flags", |
| 162 | "vold_default_libs", |
| 163 | ], |
| 164 | |
| 165 | srcs: ["main.cpp"], |
| 166 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 167 | product_variables: { |
| 168 | arc: { |
| 169 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 170 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame^] | 171 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 172 | "libarcobbvolume", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame^] | 173 | "libparcelfiledescriptor", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame] | 174 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 175 | }, |
| 176 | }, |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 177 | init_rc: [ |
| 178 | "vold.rc", |
| 179 | "wait_for_keymaster.rc", |
| 180 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 181 | |
| 182 | required: [ |
| 183 | "mke2fs", |
| 184 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 185 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 186 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 187 | |
| 188 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 189 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 190 | "libhidltransport", |
| 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", |
| 225 | "libhardware", |
| 226 | "libhardware_legacy", |
| 227 | "libhidlbase", |
| 228 | "libhwbinder", |
| 229 | "libkeymaster4support", |
| 230 | ], |
| 231 | } |
| 232 | |
| 233 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 234 | name: "secdiscard", |
| 235 | defaults: ["vold_default_flags"], |
| 236 | |
| 237 | srcs: [ |
| 238 | "FileDeviceUtils.cpp", |
| 239 | "secdiscard.cpp", |
| 240 | ], |
| 241 | shared_libs: ["libbase"], |
| 242 | } |
| 243 | |
| 244 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 245 | name: "vold_prepare_subdirs", |
| 246 | defaults: ["vold_default_flags"], |
| 247 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 248 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 249 | shared_libs: [ |
| 250 | "libbase", |
| 251 | "libcutils", |
| 252 | "liblogwrap", |
| 253 | "libselinux", |
| 254 | "libutils", |
| 255 | ], |
| 256 | static_libs: [ |
| 257 | "libvold_binder", |
| 258 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 259 | } |
| 260 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 261 | filegroup { |
| 262 | name: "vold_aidl", |
| 263 | srcs: [ |
| 264 | "binder/android/os/IVold.aidl", |
| 265 | "binder/android/os/IVoldListener.aidl", |
| 266 | "binder/android/os/IVoldTaskListener.aidl", |
| 267 | ], |
| 268 | } |
| 269 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 270 | subdirs = ["tests"] |