blob: 35f74bf6117a83419390a0ac0c2aedd1444a92b1 [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",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700126 "Keystore.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600127 "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",
Jiyong Park973e0592021-07-27 12:21:11 +0900168 "android.hardware.health.storage-V1-ndk",
169 "android.system.keystore2-V1-ndk",
170 "android.security.maintenance-ndk",
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",
Wei Wangf5b085c2018-05-15 16:12:20 -0700191 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600192
193 required: [
194 "mke2fs",
195 "vold_prepare_subdirs",
196 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700197
198 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700199 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900200 "android.hardware.health.storage-V1-ndk",
201 "android.system.keystore2-V1-ndk",
202 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800203 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800204 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700205 ],
Risan4ad20482021-01-20 05:53:15 +0000206
207 product_variables: {
208 arc: {
209 exclude_srcs: [
210 "model/StubVolume.cpp",
211 ],
212 static_libs: [
213 "libarcvolume",
214 ],
215 },
216 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600217}
218
219cc_binary {
220 name: "vdc",
221 defaults: ["vold_default_flags"],
222
Sean Keys8452f412021-07-07 22:38:04 +0000223 srcs: [
224 "vdc.cpp",
225 "Utils.cpp",
226 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600227 shared_libs: [
228 "libbase",
229 "libbinder",
230 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000231 "liblogwrap",
232 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600233 "libutils",
234 ],
235 static_libs: [
236 "libvold_binder",
237 ],
238 init_rc: ["vdc.rc"],
239}
240
241cc_binary {
242 name: "secdiscard",
243 defaults: ["vold_default_flags"],
244
245 srcs: [
246 "FileDeviceUtils.cpp",
247 "secdiscard.cpp",
248 ],
249 shared_libs: ["libbase"],
250}
251
252cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600253 name: "vold_prepare_subdirs",
254 defaults: ["vold_default_flags"],
255
Paul Crowley82b41ff2017-10-20 08:17:54 -0700256 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
257 shared_libs: [
258 "libbase",
259 "libcutils",
260 "liblogwrap",
261 "libselinux",
262 "libutils",
263 ],
264 static_libs: [
265 "libvold_binder",
266 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600267}
268
Colin Crossa8388632017-11-25 08:47:19 -0800269filegroup {
270 name: "vold_aidl",
271 srcs: [
272 "binder/android/os/IVold.aidl",
273 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000274 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800275 "binder/android/os/IVoldTaskListener.aidl",
276 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700277 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800278}