blob: f2a1a37793882c9e2a7f04e1e7a963746e57eb51 [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: [
49 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070050 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070051 "android.hardware.keymaster@4.1",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070052 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060053 "libbase",
54 "libbinder",
55 "libcrypto",
56 "libcrypto_utils",
57 "libcutils",
58 "libdiskconfig",
59 "libext4_utils",
60 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080061 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060062 "libhardware",
63 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080064 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060065 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070066 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070067 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060068 "libkeyutils",
69 "liblog",
70 "liblogwrap",
71 "libselinux",
72 "libsysutils",
73 "libutils",
74 ],
75}
76
77cc_library_static {
78 name: "libvold_binder",
79 defaults: ["vold_default_flags"],
80
81 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080082 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060083 ],
84 shared_libs: [
85 "libbinder",
86 "libutils",
87 ],
88 aidl: {
89 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080090 include_dirs: [
91 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090092 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080093 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060094 export_aidl_headers: true,
95 },
Songchun Fanab55cec2019-12-02 10:50:12 -080096 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090097 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080098 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000099 export_shared_lib_headers: [
100 "libbinder",
101 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102}
103
Risanaedae612017-11-27 18:01:35 +0900104cc_library_headers {
105 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -0700106 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900107 export_include_dirs: ["."],
108}
109
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600110// Static library factored out to support testing
111cc_library_static {
112 name: "libvold",
113 defaults: [
114 "vold_default_flags",
115 "vold_default_libs",
116 ],
117
118 srcs: [
Risanac02a482018-10-31 21:59:47 -0600119 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600120 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700121 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800122 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600123 "Devmapper.cpp",
124 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600125 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700126 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600127 "IdleMaint.cpp",
128 "KeyBuffer.cpp",
129 "KeyStorage.cpp",
130 "KeyUtil.cpp",
131 "Keymaster.cpp",
132 "Loop.cpp",
133 "MetadataCrypt.cpp",
134 "MoveStorage.cpp",
135 "NetlinkHandler.cpp",
136 "NetlinkManager.cpp",
137 "Process.cpp",
138 "ScryptParameters.cpp",
139 "Utils.cpp",
140 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700141 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600142 "VoldUtil.cpp",
143 "VolumeManager.cpp",
144 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900145 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600146 "fs/Ext4.cpp",
147 "fs/F2fs.cpp",
148 "fs/Vfat.cpp",
149 "model/Disk.cpp",
150 "model/EmulatedVolume.cpp",
151 "model/ObbVolume.cpp",
152 "model/PrivateVolume.cpp",
153 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900154 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800155 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800156 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600157 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700158 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000159 arc: {
160 exclude_srcs: [
161 "model/StubVolume.cpp",
162 ],
163 static_libs: [
164 "libarcvolume",
165 ],
166 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700167 debuggable: {
168 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
169 },
170 },
Yifan Hong024a1242018-08-10 13:50:46 -0700171 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700172 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900173 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800174 "libbinder_ndk",
Yifan Hong024a1242018-08-10 13:50:46 -0700175 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900176 whole_static_libs: [
177 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100178 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900179 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600180}
181
182cc_binary {
183 name: "vold",
184 defaults: [
185 "vold_default_flags",
186 "vold_default_libs",
187 ],
188
189 srcs: ["main.cpp"],
190 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700191 init_rc: [
192 "vold.rc",
193 "wait_for_keymaster.rc",
194 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600195
196 required: [
197 "mke2fs",
198 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800199 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600200 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700201
202 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700203 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900204 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800205 "libbinder_ndk",
Yifan Hong024a1242018-08-10 13:50:46 -0700206 ],
Risan4ad20482021-01-20 05:53:15 +0000207
208 product_variables: {
209 arc: {
210 exclude_srcs: [
211 "model/StubVolume.cpp",
212 ],
213 static_libs: [
214 "libarcvolume",
215 ],
216 },
217 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600218}
219
220cc_binary {
221 name: "vdc",
222 defaults: ["vold_default_flags"],
223
224 srcs: ["vdc.cpp"],
225 shared_libs: [
226 "libbase",
227 "libbinder",
228 "libcutils",
229 "libutils",
230 ],
231 static_libs: [
232 "libvold_binder",
233 ],
234 init_rc: ["vdc.rc"],
235}
236
237cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800238 name: "wait_for_keymaster",
239 defaults: ["vold_default_flags"],
240
241 srcs: [
242 "wait_for_keymaster.cpp",
243 "Keymaster.cpp",
244 ],
245 shared_libs: [
246 "libbase",
247 "libbinder",
248
249 "android.hardware.keymaster@3.0",
250 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700251 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800252 "libhardware",
253 "libhardware_legacy",
254 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800255 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700256 "libkeymaster4_1support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700257 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800258 ],
259}
260
261cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600262 name: "secdiscard",
263 defaults: ["vold_default_flags"],
264
265 srcs: [
266 "FileDeviceUtils.cpp",
267 "secdiscard.cpp",
268 ],
269 shared_libs: ["libbase"],
270}
271
272cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600273 name: "vold_prepare_subdirs",
274 defaults: ["vold_default_flags"],
275
Paul Crowley82b41ff2017-10-20 08:17:54 -0700276 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
277 shared_libs: [
278 "libbase",
279 "libcutils",
280 "liblogwrap",
281 "libselinux",
282 "libutils",
283 ],
284 static_libs: [
285 "libvold_binder",
286 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600287}
288
Colin Crossa8388632017-11-25 08:47:19 -0800289filegroup {
290 name: "vold_aidl",
291 srcs: [
292 "binder/android/os/IVold.aidl",
293 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000294 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800295 "binder/android/os/IVoldTaskListener.aidl",
296 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700297 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800298}