blob: e5d5e8ffec66e23939f78b171ae91a7d2b75c780 [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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060044 "libsquashfs_utils",
45 "libvold_binder",
46 ],
47 shared_libs: [
Daniel Rosenbergd3992492018-10-02 17:40:44 -070048 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060049 "libbase",
50 "libbinder",
51 "libcrypto",
52 "libcrypto_utils",
53 "libcutils",
54 "libdiskconfig",
55 "libext4_utils",
56 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080057 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060058 "libhardware",
59 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080060 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060061 "libhidlbase",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060062 "libkeyutils",
63 "liblog",
64 "liblogwrap",
65 "libselinux",
66 "libsysutils",
67 "libutils",
68 ],
69}
70
71cc_library_static {
72 name: "libvold_binder",
73 defaults: ["vold_default_flags"],
74
75 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080076 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060077 ],
78 shared_libs: [
79 "libbinder",
80 "libutils",
81 ],
82 aidl: {
83 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080084 include_dirs: [
85 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090086 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080087 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060088 export_aidl_headers: true,
89 },
Songchun Fanab55cec2019-12-02 10:50:12 -080090 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090091 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080092 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000093 export_shared_lib_headers: [
94 "libbinder",
95 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060096}
97
Risanaedae612017-11-27 18:01:35 +090098cc_library_headers {
99 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -0700100 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900101 export_include_dirs: ["."],
102}
103
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600104// Static library factored out to support testing
105cc_library_static {
106 name: "libvold",
107 defaults: [
108 "vold_default_flags",
109 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000110 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600111 ],
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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600133 "Utils.cpp",
134 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700135 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600136 "VoldUtil.cpp",
137 "VolumeManager.cpp",
138 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900139 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600140 "fs/Ext4.cpp",
141 "fs/F2fs.cpp",
142 "fs/Vfat.cpp",
143 "model/Disk.cpp",
144 "model/EmulatedVolume.cpp",
145 "model/ObbVolume.cpp",
146 "model/PrivateVolume.cpp",
147 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900148 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800149 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800150 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600151 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700152 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000153 arc: {
154 exclude_srcs: [
155 "model/StubVolume.cpp",
156 ],
157 static_libs: [
158 "libarcvolume",
159 ],
160 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700161 debuggable: {
162 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
163 },
164 },
Yifan Hong024a1242018-08-10 13:50:46 -0700165 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700166 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900167 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900168 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800169 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800170 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700171 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900172 whole_static_libs: [
173 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100174 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900175 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600176}
177
178cc_binary {
179 name: "vold",
180 defaults: [
181 "vold_default_flags",
182 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000183 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600184 ],
185
186 srcs: ["main.cpp"],
187 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700188 init_rc: [
189 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700190 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600191
192 required: [
193 "mke2fs",
194 "vold_prepare_subdirs",
195 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700196
197 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700198 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900199 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900200 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800201 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800202 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700203 ],
Risan4ad20482021-01-20 05:53:15 +0000204
205 product_variables: {
206 arc: {
207 exclude_srcs: [
208 "model/StubVolume.cpp",
209 ],
210 static_libs: [
211 "libarcvolume",
212 ],
213 },
214 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600215}
216
217cc_binary {
218 name: "vdc",
219 defaults: ["vold_default_flags"],
220
Sean Keys8452f412021-07-07 22:38:04 +0000221 srcs: [
222 "vdc.cpp",
223 "Utils.cpp",
224 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600225 shared_libs: [
226 "libbase",
227 "libbinder",
228 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000229 "liblogwrap",
230 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600231 "libutils",
232 ],
233 static_libs: [
234 "libvold_binder",
235 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600236}
237
238cc_binary {
239 name: "secdiscard",
240 defaults: ["vold_default_flags"],
241
242 srcs: [
243 "FileDeviceUtils.cpp",
244 "secdiscard.cpp",
245 ],
246 shared_libs: ["libbase"],
247}
248
249cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600250 name: "vold_prepare_subdirs",
251 defaults: ["vold_default_flags"],
252
Paul Crowley82b41ff2017-10-20 08:17:54 -0700253 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
254 shared_libs: [
255 "libbase",
256 "libcutils",
257 "liblogwrap",
258 "libselinux",
259 "libutils",
260 ],
261 static_libs: [
262 "libvold_binder",
263 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600264}
265
Colin Crossa8388632017-11-25 08:47:19 -0800266filegroup {
267 name: "vold_aidl",
268 srcs: [
269 "binder/android/os/IVold.aidl",
270 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000271 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800272 "binder/android/os/IVoldTaskListener.aidl",
273 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700274 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800275}