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