blob: 1ccfc097dd9a87c4aa6985114dfd65677aabcc65 [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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060012 "-Wno-unused-parameter",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060013 ],
14
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060015 tidy: true,
16 tidy_checks: [
17 "-*",
18 "cert-*",
19 "clang-analyzer-security*",
Nick Kralevichd78fb532019-03-29 16:07:58 -070020 "android-*",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060021 ],
Chih-Hung Hsieh1ab55a52022-04-27 15:54:25 -070022 tidy_checks_as_errors: [
23 "clang-analyzer-security*",
24 "cert-*",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060025 ],
26}
27
28cc_defaults {
29 name: "vold_default_libs",
30
31 static_libs: [
Narayan Kamath02efdf52019-11-27 10:53:51 +000032 "libasync_safe",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060033 "libavb",
34 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070035 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070036 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060037 "libfec",
38 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080039 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060040 "libfs_mgr",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060041 "libsquashfs_utils",
42 "libvold_binder",
43 ],
44 shared_libs: [
Daniel Rosenbergd3992492018-10-02 17:40:44 -070045 "android.hardware.boot@1.0",
Kelvin Zhangdec03ab2022-06-21 14:31:01 -070046 "android.hardware.boot-V1-ndk",
47 "libboot_control_client",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060048 "libbase",
49 "libbinder",
50 "libcrypto",
51 "libcrypto_utils",
52 "libcutils",
53 "libdiskconfig",
54 "libext4_utils",
55 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080056 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060057 "libhardware",
58 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080059 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libhidlbase",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060061 "libkeyutils",
62 "liblog",
63 "liblogwrap",
64 "libselinux",
65 "libsysutils",
66 "libutils",
67 ],
68}
69
70cc_library_static {
71 name: "libvold_binder",
72 defaults: ["vold_default_flags"],
73
74 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080075 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060076 ],
77 shared_libs: [
78 "libbinder",
79 "libutils",
80 ],
81 aidl: {
82 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080083 include_dirs: [
84 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090085 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080086 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060087 export_aidl_headers: true,
88 },
Songchun Fanab55cec2019-12-02 10:50:12 -080089 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090090 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080091 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000092 export_shared_lib_headers: [
93 "libbinder",
94 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060095}
96
Risanaedae612017-11-27 18:01:35 +090097cc_library_headers {
98 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070099 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900100 export_include_dirs: ["."],
101}
102
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600103// Static library factored out to support testing
104cc_library_static {
105 name: "libvold",
106 defaults: [
107 "vold_default_flags",
108 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000109 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600110 ],
111
112 srcs: [
Risanac02a482018-10-31 21:59:47 -0600113 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600114 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700115 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800116 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600117 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600118 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700119 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600120 "IdleMaint.cpp",
121 "KeyBuffer.cpp",
122 "KeyStorage.cpp",
123 "KeyUtil.cpp",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700124 "Keystore.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600125 "Loop.cpp",
126 "MetadataCrypt.cpp",
127 "MoveStorage.cpp",
128 "NetlinkHandler.cpp",
129 "NetlinkManager.cpp",
130 "Process.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600131 "Utils.cpp",
132 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700133 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600134 "VoldUtil.cpp",
135 "VolumeManager.cpp",
136 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900137 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600138 "fs/Ext4.cpp",
139 "fs/F2fs.cpp",
140 "fs/Vfat.cpp",
141 "model/Disk.cpp",
142 "model/EmulatedVolume.cpp",
143 "model/ObbVolume.cpp",
144 "model/PrivateVolume.cpp",
145 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900146 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800147 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800148 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600149 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700150 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000151 arc: {
152 exclude_srcs: [
153 "model/StubVolume.cpp",
154 ],
155 static_libs: [
156 "libarcvolume",
157 ],
158 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700159 debuggable: {
160 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
161 },
162 },
Yifan Hong024a1242018-08-10 13:50:46 -0700163 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700164 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900165 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900166 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800167 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800168 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700169 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900170 whole_static_libs: [
Trevor Radcliffec6644f92022-06-08 14:08:27 +0000171 "libcom.android.sysprop.apex",
Alix34778692022-04-18 04:00:10 +0000172 "libc++fs",
Jiyong Park8d21c922019-01-04 13:35:25 +0900173 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600174}
175
176cc_binary {
177 name: "vold",
178 defaults: [
179 "vold_default_flags",
180 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000181 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600182 ],
183
184 srcs: ["main.cpp"],
185 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700186 init_rc: [
187 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700188 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600189
190 required: [
191 "mke2fs",
192 "vold_prepare_subdirs",
Ken Chen0093f6a2022-07-11 22:12:39 +0800193 "fuseMedia.o",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600194 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700195
196 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700197 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900198 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900199 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800200 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800201 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700202 ],
Risan4ad20482021-01-20 05:53:15 +0000203
204 product_variables: {
205 arc: {
206 exclude_srcs: [
207 "model/StubVolume.cpp",
208 ],
209 static_libs: [
210 "libarcvolume",
211 ],
212 },
Alix34778692022-04-18 04:00:10 +0000213 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600214}
215
216cc_binary {
217 name: "vdc",
218 defaults: ["vold_default_flags"],
219
Sean Keys8452f412021-07-07 22:38:04 +0000220 srcs: [
221 "vdc.cpp",
222 "Utils.cpp",
223 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600224 shared_libs: [
225 "libbase",
226 "libbinder",
227 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000228 "liblogwrap",
229 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600230 "libutils",
231 ],
232 static_libs: [
233 "libvold_binder",
234 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600235}
236
237cc_binary {
238 name: "secdiscard",
239 defaults: ["vold_default_flags"],
240
241 srcs: [
242 "FileDeviceUtils.cpp",
243 "secdiscard.cpp",
244 ],
245 shared_libs: ["libbase"],
246}
247
248cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600249 name: "vold_prepare_subdirs",
250 defaults: ["vold_default_flags"],
251
Alix34778692022-04-18 04:00:10 +0000252 srcs: [
253 "vold_prepare_subdirs.cpp",
254 "Utils.cpp",
255 ],
Paul Crowley82b41ff2017-10-20 08:17:54 -0700256 shared_libs: [
257 "libbase",
258 "libcutils",
259 "liblogwrap",
260 "libselinux",
261 "libutils",
262 ],
263 static_libs: [
264 "libvold_binder",
265 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600266}
267
Colin Crossa8388632017-11-25 08:47:19 -0800268filegroup {
269 name: "vold_aidl",
270 srcs: [
271 "binder/android/os/IVold.aidl",
272 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000273 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800274 "binder/android/os/IVoldTaskListener.aidl",
275 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700276 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800277}