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