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