blob: d2c6ffc8b59391870f5a8ab36ba17e77d3de9644 [file] [log] [blame]
Bob Badour8eb43ae2021-02-12 14:24:10 -08001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
Jeff Sharkeyd16dc502017-10-23 14:38:55 -06005cc_defaults {
6 name: "vold_default_flags",
7
8 cflags: [
9 "-Wall",
10 "-Werror",
11 "-Wextra",
12 "-Wno-missing-field-initializers",
13 "-Wno-unused-parameter",
14 "-Wno-unused-variable",
15 ],
16
17 clang: true,
18
19 tidy: true,
20 tidy_checks: [
21 "-*",
22 "cert-*",
23 "clang-analyzer-security*",
Nick Kralevichd78fb532019-03-29 16:07:58 -070024 "android-*",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060025 ],
26 tidy_flags: [
27 "-warnings-as-errors=clang-analyzer-security*,cert-*",
28 ],
29}
30
31cc_defaults {
32 name: "vold_default_libs",
33
34 static_libs: [
Narayan Kamath02efdf52019-11-27 10:53:51 +000035 "libasync_safe",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060036 "libavb",
37 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070038 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070039 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060040 "libfec",
41 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080042 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060043 "libfs_mgr",
44 "libscrypt_static",
45 "libsquashfs_utils",
46 "libvold_binder",
47 ],
48 shared_libs: [
Daniel Rosenbergd3992492018-10-02 17:40:44 -070049 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060050 "libbase",
51 "libbinder",
52 "libcrypto",
53 "libcrypto_utils",
54 "libcutils",
55 "libdiskconfig",
56 "libext4_utils",
57 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080058 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060059 "libhardware",
60 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080061 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060062 "libhidlbase",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060063 "libkeyutils",
64 "liblog",
65 "liblogwrap",
66 "libselinux",
67 "libsysutils",
68 "libutils",
69 ],
70}
71
72cc_library_static {
73 name: "libvold_binder",
74 defaults: ["vold_default_flags"],
75
76 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080077 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060078 ],
79 shared_libs: [
80 "libbinder",
81 "libutils",
82 ],
83 aidl: {
84 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080085 include_dirs: [
86 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090087 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080088 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060089 export_aidl_headers: true,
90 },
Songchun Fanab55cec2019-12-02 10:50:12 -080091 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090092 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080093 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000094 export_shared_lib_headers: [
95 "libbinder",
96 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060097}
98
Risanaedae612017-11-27 18:01:35 +090099cc_library_headers {
100 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -0700101 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900102 export_include_dirs: ["."],
103}
104
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600105// Static library factored out to support testing
106cc_library_static {
107 name: "libvold",
108 defaults: [
109 "vold_default_flags",
110 "vold_default_libs",
111 ],
112
113 srcs: [
Risanac02a482018-10-31 21:59:47 -0600114 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600115 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700116 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800117 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600118 "Devmapper.cpp",
119 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600120 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700121 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600122 "IdleMaint.cpp",
123 "KeyBuffer.cpp",
124 "KeyStorage.cpp",
125 "KeyUtil.cpp",
126 "Keymaster.cpp",
127 "Loop.cpp",
128 "MetadataCrypt.cpp",
129 "MoveStorage.cpp",
130 "NetlinkHandler.cpp",
131 "NetlinkManager.cpp",
132 "Process.cpp",
133 "ScryptParameters.cpp",
134 "Utils.cpp",
135 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700136 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600137 "VoldUtil.cpp",
138 "VolumeManager.cpp",
139 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900140 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600141 "fs/Ext4.cpp",
142 "fs/F2fs.cpp",
143 "fs/Vfat.cpp",
144 "model/Disk.cpp",
145 "model/EmulatedVolume.cpp",
146 "model/ObbVolume.cpp",
147 "model/PrivateVolume.cpp",
148 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900149 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800150 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800151 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600152 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700153 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000154 arc: {
155 exclude_srcs: [
156 "model/StubVolume.cpp",
157 ],
158 static_libs: [
159 "libarcvolume",
160 ],
161 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700162 debuggable: {
163 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
164 },
165 },
Yifan Hong024a1242018-08-10 13:50:46 -0700166 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700167 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900168 "android.hardware.health.storage-V1-ndk_platform",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800169 "android.system.keystore2-V1-ndk_platform",
170 "android.security.maintenance-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800171 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800172 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700173 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900174 whole_static_libs: [
175 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100176 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900177 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600178}
179
180cc_binary {
181 name: "vold",
182 defaults: [
183 "vold_default_flags",
184 "vold_default_libs",
185 ],
186
187 srcs: ["main.cpp"],
188 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700189 init_rc: [
190 "vold.rc",
191 "wait_for_keymaster.rc",
192 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600193
194 required: [
195 "mke2fs",
196 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800197 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600198 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700199
200 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700201 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900202 "android.hardware.health.storage-V1-ndk_platform",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800203 "android.system.keystore2-V1-ndk_platform",
204 "android.security.maintenance-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800205 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800206 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700207 ],
Risan4ad20482021-01-20 05:53:15 +0000208
209 product_variables: {
210 arc: {
211 exclude_srcs: [
212 "model/StubVolume.cpp",
213 ],
214 static_libs: [
215 "libarcvolume",
216 ],
217 },
218 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600219}
220
221cc_binary {
222 name: "vdc",
223 defaults: ["vold_default_flags"],
224
Sean Keysc11f7de2021-07-07 22:38:04 +0000225 srcs: [
226 "vdc.cpp",
227 "Utils.cpp",
228 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600229 shared_libs: [
230 "libbase",
231 "libbinder",
232 "libcutils",
Sean Keysc11f7de2021-07-07 22:38:04 +0000233 "liblogwrap",
234 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600235 "libutils",
236 ],
237 static_libs: [
238 "libvold_binder",
239 ],
240 init_rc: ["vdc.rc"],
241}
242
243cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800244 name: "wait_for_keymaster",
245 defaults: ["vold_default_flags"],
246
247 srcs: [
248 "wait_for_keymaster.cpp",
249 "Keymaster.cpp",
250 ],
251 shared_libs: [
252 "libbase",
253 "libbinder",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800254 "libbinder_ndk",
Paul Crowley8f828792018-02-07 14:41:26 -0800255
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800256 "android.system.keystore2-V1-ndk_platform",
257 "android.security.maintenance-ndk_platform",
Paul Crowley8f828792018-02-07 14:41:26 -0800258 "libhardware",
259 "libhardware_legacy",
260 "libhidlbase",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800261 "libkeymint_support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700262 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800263 ],
264}
265
266cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600267 name: "secdiscard",
268 defaults: ["vold_default_flags"],
269
270 srcs: [
271 "FileDeviceUtils.cpp",
272 "secdiscard.cpp",
273 ],
274 shared_libs: ["libbase"],
275}
276
277cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600278 name: "vold_prepare_subdirs",
279 defaults: ["vold_default_flags"],
280
Paul Crowley82b41ff2017-10-20 08:17:54 -0700281 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
282 shared_libs: [
283 "libbase",
284 "libcutils",
285 "liblogwrap",
286 "libselinux",
287 "libutils",
288 ],
289 static_libs: [
290 "libvold_binder",
291 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600292}
293
Colin Crossa8388632017-11-25 08:47:19 -0800294filegroup {
295 name: "vold_aidl",
296 srcs: [
297 "binder/android/os/IVold.aidl",
298 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000299 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800300 "binder/android/os/IVoldTaskListener.aidl",
301 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700302 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800303}