blob: c113ed0d2ddc14445c5fa184ccb5db944f24e4bf [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
15 clang: true,
16
17 tidy: true,
18 tidy_checks: [
19 "-*",
20 "cert-*",
21 "clang-analyzer-security*",
Nick Kralevichd78fb532019-03-29 16:07:58 -070022 "android-*",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060023 ],
24 tidy_flags: [
25 "-warnings-as-errors=clang-analyzer-security*,cert-*",
26 ],
27}
28
29cc_defaults {
30 name: "vold_default_libs",
31
32 static_libs: [
Narayan Kamath02efdf52019-11-27 10:53:51 +000033 "libasync_safe",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060034 "libavb",
35 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070036 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070037 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060038 "libfec",
39 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080040 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060041 "libfs_mgr",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060042 "libsquashfs_utils",
43 "libvold_binder",
44 ],
45 shared_libs: [
Daniel Rosenbergd3992492018-10-02 17:40:44 -070046 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060047 "libbase",
48 "libbinder",
49 "libcrypto",
50 "libcrypto_utils",
51 "libcutils",
52 "libdiskconfig",
53 "libext4_utils",
54 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080055 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060056 "libhardware",
57 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080058 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060059 "libhidlbase",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libkeyutils",
61 "liblog",
62 "liblogwrap",
63 "libselinux",
64 "libsysutils",
65 "libutils",
66 ],
67}
68
69cc_library_static {
70 name: "libvold_binder",
71 defaults: ["vold_default_flags"],
72
73 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080074 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060075 ],
76 shared_libs: [
77 "libbinder",
78 "libutils",
79 ],
80 aidl: {
81 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080082 include_dirs: [
83 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090084 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080085 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060086 export_aidl_headers: true,
87 },
Songchun Fanab55cec2019-12-02 10:50:12 -080088 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090089 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080090 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000091 export_shared_lib_headers: [
92 "libbinder",
93 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060094}
95
Risanaedae612017-11-27 18:01:35 +090096cc_library_headers {
97 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070098 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090099 export_include_dirs: ["."],
100}
101
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102// Static library factored out to support testing
103cc_library_static {
104 name: "libvold",
105 defaults: [
106 "vold_default_flags",
107 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000108 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600109 ],
110
111 srcs: [
Risanac02a482018-10-31 21:59:47 -0600112 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600113 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700114 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800115 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600116 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600117 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700118 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600119 "IdleMaint.cpp",
120 "KeyBuffer.cpp",
121 "KeyStorage.cpp",
122 "KeyUtil.cpp",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700123 "Keystore.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600124 "Loop.cpp",
125 "MetadataCrypt.cpp",
126 "MoveStorage.cpp",
127 "NetlinkHandler.cpp",
128 "NetlinkManager.cpp",
129 "Process.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600130 "Utils.cpp",
131 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700132 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600133 "VoldUtil.cpp",
134 "VolumeManager.cpp",
135 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900136 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600137 "fs/Ext4.cpp",
138 "fs/F2fs.cpp",
139 "fs/Vfat.cpp",
140 "model/Disk.cpp",
141 "model/EmulatedVolume.cpp",
142 "model/ObbVolume.cpp",
143 "model/PrivateVolume.cpp",
144 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900145 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800146 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800147 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600148 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700149 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000150 arc: {
151 exclude_srcs: [
152 "model/StubVolume.cpp",
153 ],
154 static_libs: [
155 "libarcvolume",
156 ],
157 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700158 debuggable: {
159 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
160 },
161 },
Yifan Hong024a1242018-08-10 13:50:46 -0700162 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700163 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900164 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900165 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800166 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800167 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700168 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900169 whole_static_libs: [
170 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100171 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900172 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600173}
174
175cc_binary {
176 name: "vold",
177 defaults: [
178 "vold_default_flags",
179 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000180 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600181 ],
182
183 srcs: ["main.cpp"],
184 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700185 init_rc: [
186 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700187 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600188
189 required: [
190 "mke2fs",
191 "vold_prepare_subdirs",
Paul Lawrence5defbf92021-11-09 16:34:46 +0000192 "fuse_media.o",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600193 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700194
195 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700196 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900197 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900198 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800199 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800200 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700201 ],
Risan4ad20482021-01-20 05:53:15 +0000202
203 product_variables: {
204 arc: {
205 exclude_srcs: [
206 "model/StubVolume.cpp",
207 ],
208 static_libs: [
209 "libarcvolume",
210 ],
211 },
212 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600213}
214
215cc_binary {
216 name: "vdc",
217 defaults: ["vold_default_flags"],
218
Sean Keys8452f412021-07-07 22:38:04 +0000219 srcs: [
220 "vdc.cpp",
221 "Utils.cpp",
222 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600223 shared_libs: [
224 "libbase",
225 "libbinder",
226 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000227 "liblogwrap",
228 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600229 "libutils",
230 ],
231 static_libs: [
232 "libvold_binder",
233 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600234}
235
236cc_binary {
237 name: "secdiscard",
238 defaults: ["vold_default_flags"],
239
240 srcs: [
241 "FileDeviceUtils.cpp",
242 "secdiscard.cpp",
243 ],
244 shared_libs: ["libbase"],
245}
246
247cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600248 name: "vold_prepare_subdirs",
249 defaults: ["vold_default_flags"],
250
Paul Crowley82b41ff2017-10-20 08:17:54 -0700251 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
252 shared_libs: [
253 "libbase",
254 "libcutils",
255 "liblogwrap",
256 "libselinux",
257 "libutils",
258 ],
259 static_libs: [
260 "libvold_binder",
261 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600262}
263
Colin Crossa8388632017-11-25 08:47:19 -0800264filegroup {
265 name: "vold_aidl",
266 srcs: [
267 "binder/android/os/IVold.aidl",
268 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000269 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800270 "binder/android/os/IVoldTaskListener.aidl",
271 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700272 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800273}