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