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