blob: 4f39eb1b052e042aa6d89e71d94b419ed10404f3 [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",
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
225 srcs: ["vdc.cpp"],
226 shared_libs: [
227 "libbase",
228 "libbinder",
229 "libcutils",
230 "libutils",
231 ],
232 static_libs: [
233 "libvold_binder",
234 ],
235 init_rc: ["vdc.rc"],
236}
237
238cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800239 name: "wait_for_keymaster",
240 defaults: ["vold_default_flags"],
241
242 srcs: [
243 "wait_for_keymaster.cpp",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700244 "Keystore.cpp",
Paul Crowley8f828792018-02-07 14:41:26 -0800245 ],
246 shared_libs: [
247 "libbase",
248 "libbinder",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800249 "libbinder_ndk",
Paul Crowley8f828792018-02-07 14:41:26 -0800250
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800251 "android.system.keystore2-V1-ndk_platform",
252 "android.security.maintenance-ndk_platform",
Paul Crowley8f828792018-02-07 14:41:26 -0800253 "libhardware",
254 "libhardware_legacy",
255 "libhidlbase",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800256 "libkeymint_support",
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}