blob: 8f413c4e25a9c644c349fa8309367dc59977f0b4 [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 ],
22 tidy_flags: [
23 "-warnings-as-errors=clang-analyzer-security*,cert-*",
24 ],
25}
26
27cc_defaults {
28 name: "vold_default_libs",
29
30 static_libs: [
Narayan Kamath02efdf52019-11-27 10:53:51 +000031 "libasync_safe",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060032 "libavb",
33 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070034 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070035 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060036 "libfec",
37 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080038 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060039 "libfs_mgr",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060040 "libsquashfs_utils",
41 "libvold_binder",
42 ],
43 shared_libs: [
Daniel Rosenbergd3992492018-10-02 17:40:44 -070044 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060045 "libbase",
46 "libbinder",
47 "libcrypto",
48 "libcrypto_utils",
49 "libcutils",
50 "libdiskconfig",
51 "libext4_utils",
52 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080053 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060054 "libhardware",
55 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080056 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060057 "libhidlbase",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060058 "libkeyutils",
59 "liblog",
60 "liblogwrap",
61 "libselinux",
62 "libsysutils",
63 "libutils",
64 ],
65}
66
67cc_library_static {
68 name: "libvold_binder",
69 defaults: ["vold_default_flags"],
70
71 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080072 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060073 ],
74 shared_libs: [
75 "libbinder",
76 "libutils",
77 ],
78 aidl: {
79 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080080 include_dirs: [
81 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090082 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080083 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060084 export_aidl_headers: true,
85 },
Songchun Fanab55cec2019-12-02 10:50:12 -080086 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090087 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080088 ],
Songchun Fanf77beb52021-02-25 23:16:11 +000089 export_shared_lib_headers: [
90 "libbinder",
91 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060092}
93
Risanaedae612017-11-27 18:01:35 +090094cc_library_headers {
95 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070096 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090097 export_include_dirs: ["."],
98}
99
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600100// Static library factored out to support testing
101cc_library_static {
102 name: "libvold",
103 defaults: [
104 "vold_default_flags",
105 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000106 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600107 ],
108
109 srcs: [
Risanac02a482018-10-31 21:59:47 -0600110 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600111 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700112 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800113 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600114 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600115 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700116 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600117 "IdleMaint.cpp",
118 "KeyBuffer.cpp",
119 "KeyStorage.cpp",
120 "KeyUtil.cpp",
Eric Biggersd86a8ab2021-06-15 11:34:00 -0700121 "Keystore.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600122 "Loop.cpp",
123 "MetadataCrypt.cpp",
124 "MoveStorage.cpp",
125 "NetlinkHandler.cpp",
126 "NetlinkManager.cpp",
127 "Process.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600128 "Utils.cpp",
129 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700130 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600131 "VoldUtil.cpp",
132 "VolumeManager.cpp",
133 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900134 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600135 "fs/Ext4.cpp",
136 "fs/F2fs.cpp",
137 "fs/Vfat.cpp",
138 "model/Disk.cpp",
139 "model/EmulatedVolume.cpp",
140 "model/ObbVolume.cpp",
141 "model/PrivateVolume.cpp",
142 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900143 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800144 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800145 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600146 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700147 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000148 arc: {
149 exclude_srcs: [
150 "model/StubVolume.cpp",
151 ],
152 static_libs: [
153 "libarcvolume",
154 ],
155 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700156 debuggable: {
157 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
158 },
159 },
Yifan Hong024a1242018-08-10 13:50:46 -0700160 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700161 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900162 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900163 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800164 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800165 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700166 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900167 whole_static_libs: [
168 "com.android.sysprop.apex",
Alix34778692022-04-18 04:00:10 +0000169 "libc++fs",
Jiyong Park8d21c922019-01-04 13:35:25 +0900170 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600171}
172
173cc_binary {
174 name: "vold",
175 defaults: [
176 "vold_default_flags",
177 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000178 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600179 ],
180
181 srcs: ["main.cpp"],
182 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700183 init_rc: [
184 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700185 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600186
187 required: [
188 "mke2fs",
189 "vold_prepare_subdirs",
Paul Lawrence5defbf92021-11-09 16:34:46 +0000190 "fuse_media.o",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600191 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700192
193 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700194 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900195 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900196 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800197 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800198 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700199 ],
Risan4ad20482021-01-20 05:53:15 +0000200
201 product_variables: {
202 arc: {
203 exclude_srcs: [
204 "model/StubVolume.cpp",
205 ],
206 static_libs: [
207 "libarcvolume",
208 ],
209 },
Alix34778692022-04-18 04:00:10 +0000210 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600211}
212
213cc_binary {
214 name: "vdc",
215 defaults: ["vold_default_flags"],
216
Sean Keys8452f412021-07-07 22:38:04 +0000217 srcs: [
218 "vdc.cpp",
219 "Utils.cpp",
220 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600221 shared_libs: [
222 "libbase",
223 "libbinder",
224 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000225 "liblogwrap",
226 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600227 "libutils",
228 ],
229 static_libs: [
230 "libvold_binder",
231 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600232}
233
234cc_binary {
235 name: "secdiscard",
236 defaults: ["vold_default_flags"],
237
238 srcs: [
239 "FileDeviceUtils.cpp",
240 "secdiscard.cpp",
241 ],
242 shared_libs: ["libbase"],
243}
244
245cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600246 name: "vold_prepare_subdirs",
247 defaults: ["vold_default_flags"],
248
Alix34778692022-04-18 04:00:10 +0000249 srcs: [
250 "vold_prepare_subdirs.cpp",
251 "Utils.cpp",
252 ],
Paul Crowley82b41ff2017-10-20 08:17:54 -0700253 shared_libs: [
254 "libbase",
255 "libcutils",
256 "liblogwrap",
257 "libselinux",
258 "libutils",
259 ],
260 static_libs: [
261 "libvold_binder",
262 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600263}
264
Colin Crossa8388632017-11-25 08:47:19 -0800265filegroup {
266 name: "vold_aidl",
267 srcs: [
268 "binder/android/os/IVold.aidl",
269 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000270 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800271 "binder/android/os/IVoldTaskListener.aidl",
272 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700273 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800274}