blob: d9d6e1209503590cbe83d0f08c18d9fdf25d8f24 [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",
110 ],
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 "Devmapper.cpp",
118 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600119 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700120 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600121 "IdleMaint.cpp",
122 "KeyBuffer.cpp",
123 "KeyStorage.cpp",
124 "KeyUtil.cpp",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700125 "Keystore.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600126 "Loop.cpp",
127 "MetadataCrypt.cpp",
128 "MoveStorage.cpp",
129 "NetlinkHandler.cpp",
130 "NetlinkManager.cpp",
131 "Process.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600132 "Utils.cpp",
133 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700134 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600135 "VoldUtil.cpp",
136 "VolumeManager.cpp",
137 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900138 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600139 "fs/Ext4.cpp",
140 "fs/F2fs.cpp",
141 "fs/Vfat.cpp",
142 "model/Disk.cpp",
143 "model/EmulatedVolume.cpp",
144 "model/ObbVolume.cpp",
145 "model/PrivateVolume.cpp",
146 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900147 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800148 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800149 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600150 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700151 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000152 arc: {
153 exclude_srcs: [
154 "model/StubVolume.cpp",
155 ],
156 static_libs: [
157 "libarcvolume",
158 ],
159 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700160 debuggable: {
161 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
162 },
163 },
Yifan Hong024a1242018-08-10 13:50:46 -0700164 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700165 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900166 "android.hardware.health.storage-V1-ndk",
167 "android.system.keystore2-V1-ndk",
168 "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",
183 ],
184
185 srcs: ["main.cpp"],
186 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700187 init_rc: [
188 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700189 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600190
191 required: [
192 "mke2fs",
193 "vold_prepare_subdirs",
Paul Lawrence5defbf92021-11-09 16:34:46 +0000194 "fuse_media.o",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600195 ],
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",
200 "android.system.keystore2-V1-ndk",
201 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800202 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800203 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700204 ],
Risan4ad20482021-01-20 05:53:15 +0000205
206 product_variables: {
207 arc: {
208 exclude_srcs: [
209 "model/StubVolume.cpp",
210 ],
211 static_libs: [
212 "libarcvolume",
213 ],
214 },
215 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600216}
217
218cc_binary {
219 name: "vdc",
220 defaults: ["vold_default_flags"],
221
Sean Keys8452f412021-07-07 22:38:04 +0000222 srcs: [
223 "vdc.cpp",
224 "Utils.cpp",
225 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600226 shared_libs: [
227 "libbase",
228 "libbinder",
229 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000230 "liblogwrap",
231 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600232 "libutils",
233 ],
234 static_libs: [
235 "libvold_binder",
236 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600237}
238
239cc_binary {
240 name: "secdiscard",
241 defaults: ["vold_default_flags"],
242
243 srcs: [
244 "FileDeviceUtils.cpp",
245 "secdiscard.cpp",
246 ],
247 shared_libs: ["libbase"],
248}
249
250cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600251 name: "vold_prepare_subdirs",
252 defaults: ["vold_default_flags"],
253
Paul Crowley82b41ff2017-10-20 08:17:54 -0700254 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
255 shared_libs: [
256 "libbase",
257 "libcutils",
258 "liblogwrap",
259 "libselinux",
260 "libutils",
261 ],
262 static_libs: [
263 "libvold_binder",
264 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600265}
266
Colin Crossa8388632017-11-25 08:47:19 -0800267filegroup {
268 name: "vold_aidl",
269 srcs: [
270 "binder/android/os/IVold.aidl",
271 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000272 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800273 "binder/android/os/IVoldTaskListener.aidl",
274 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700275 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800276}