blob: 1112b558e05a3e29e95ca3f6b87610762f664790 [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",
Dan Pasanen16cbb8d2015-10-27 22:52:37 -0500137 "fs/Ntfs.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600138 "fs/Vfat.cpp",
139 "model/Disk.cpp",
140 "model/EmulatedVolume.cpp",
141 "model/ObbVolume.cpp",
142 "model/PrivateVolume.cpp",
143 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900144 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800145 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800146 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600147 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700148 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000149 arc: {
150 exclude_srcs: [
151 "model/StubVolume.cpp",
152 ],
153 static_libs: [
154 "libarcvolume",
155 ],
156 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700157 debuggable: {
158 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
159 },
160 },
Yifan Hong024a1242018-08-10 13:50:46 -0700161 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700162 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900163 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900164 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800165 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800166 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700167 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900168 whole_static_libs: [
169 "com.android.sysprop.apex",
Alix34778692022-04-18 04:00:10 +0000170 "libc++fs",
Jiyong Park8d21c922019-01-04 13:35:25 +0900171 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600172}
173
174cc_binary {
175 name: "vold",
176 defaults: [
177 "vold_default_flags",
178 "vold_default_libs",
David Drysdale4babbc72021-11-22 18:19:40 +0000179 "keystore2_use_latest_aidl_ndk_shared",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600180 ],
181
182 srcs: ["main.cpp"],
183 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700184 init_rc: [
185 "vold.rc",
Wei Wangf5b085c2018-05-15 16:12:20 -0700186 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600187
188 required: [
189 "mke2fs",
190 "vold_prepare_subdirs",
Paul Lawrence5defbf92021-11-09 16:34:46 +0000191 "fuse_media.o",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600192 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700193
194 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700195 "android.hardware.health.storage@1.0",
Jiyong Park973e0592021-07-27 12:21:11 +0900196 "android.hardware.health.storage-V1-ndk",
Jiyong Park973e0592021-07-27 12:21:11 +0900197 "android.security.maintenance-ndk",
Yifan Honge1e49452021-01-13 17:27:42 -0800198 "libbinder_ndk",
Satya Tangiralae8de4ff2021-02-28 22:32:07 -0800199 "libkeymint_support",
Yifan Hong024a1242018-08-10 13:50:46 -0700200 ],
Risan4ad20482021-01-20 05:53:15 +0000201
202 product_variables: {
203 arc: {
204 exclude_srcs: [
205 "model/StubVolume.cpp",
206 ],
207 static_libs: [
208 "libarcvolume",
209 ],
210 },
Alix34778692022-04-18 04:00:10 +0000211 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600212}
213
214cc_binary {
215 name: "vdc",
216 defaults: ["vold_default_flags"],
217
Sean Keys8452f412021-07-07 22:38:04 +0000218 srcs: [
219 "vdc.cpp",
220 "Utils.cpp",
221 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600222 shared_libs: [
223 "libbase",
224 "libbinder",
225 "libcutils",
Sean Keys8452f412021-07-07 22:38:04 +0000226 "liblogwrap",
227 "libselinux",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600228 "libutils",
229 ],
230 static_libs: [
231 "libvold_binder",
232 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600233}
234
235cc_binary {
236 name: "secdiscard",
237 defaults: ["vold_default_flags"],
238
239 srcs: [
240 "FileDeviceUtils.cpp",
241 "secdiscard.cpp",
242 ],
243 shared_libs: ["libbase"],
244}
245
246cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600247 name: "vold_prepare_subdirs",
248 defaults: ["vold_default_flags"],
249
Alix34778692022-04-18 04:00:10 +0000250 srcs: [
251 "vold_prepare_subdirs.cpp",
252 "Utils.cpp",
253 ],
Paul Crowley82b41ff2017-10-20 08:17:54 -0700254 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}