blob: fa8f24984ef82e7b126ae38924fa6660432e4465 [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",
44 "libscrypt_static",
45 "libsquashfs_utils",
46 "libvold_binder",
47 ],
48 shared_libs: [
49 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070050 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070051 "android.hardware.keymaster@4.1",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070052 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060053 "libbase",
54 "libbinder",
55 "libcrypto",
56 "libcrypto_utils",
57 "libcutils",
58 "libdiskconfig",
59 "libext4_utils",
60 "libf2fs_sparseblock",
Yo Chiang0af25a32020-10-07 14:20:00 +080061 "libgsi",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060062 "libhardware",
63 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080064 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060065 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070066 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070067 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060068 "libkeyutils",
69 "liblog",
70 "liblogwrap",
71 "libselinux",
72 "libsysutils",
73 "libutils",
74 ],
75}
76
77cc_library_static {
78 name: "libvold_binder",
79 defaults: ["vold_default_flags"],
80
81 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080082 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060083 ],
84 shared_libs: [
85 "libbinder",
86 "libutils",
87 ],
88 aidl: {
89 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080090 include_dirs: [
91 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090092 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080093 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060094 export_aidl_headers: true,
95 },
Songchun Fanab55cec2019-12-02 10:50:12 -080096 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090097 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080098 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060099}
100
Risanaedae612017-11-27 18:01:35 +0900101cc_library_headers {
102 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -0700103 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900104 export_include_dirs: ["."],
105}
106
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600107// Static library factored out to support testing
108cc_library_static {
109 name: "libvold",
110 defaults: [
111 "vold_default_flags",
112 "vold_default_libs",
113 ],
114
115 srcs: [
Risanac02a482018-10-31 21:59:47 -0600116 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600117 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700118 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800119 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600120 "Devmapper.cpp",
121 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600122 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700123 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600124 "IdleMaint.cpp",
125 "KeyBuffer.cpp",
126 "KeyStorage.cpp",
127 "KeyUtil.cpp",
128 "Keymaster.cpp",
129 "Loop.cpp",
130 "MetadataCrypt.cpp",
131 "MoveStorage.cpp",
132 "NetlinkHandler.cpp",
133 "NetlinkManager.cpp",
134 "Process.cpp",
135 "ScryptParameters.cpp",
136 "Utils.cpp",
137 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700138 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600139 "VoldUtil.cpp",
140 "VolumeManager.cpp",
141 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900142 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600143 "fs/Ext4.cpp",
144 "fs/F2fs.cpp",
145 "fs/Vfat.cpp",
146 "model/Disk.cpp",
147 "model/EmulatedVolume.cpp",
148 "model/ObbVolume.cpp",
149 "model/PrivateVolume.cpp",
150 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900151 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800152 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800153 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600154 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700155 product_variables: {
Risan4ad20482021-01-20 05:53:15 +0000156 arc: {
157 exclude_srcs: [
158 "model/StubVolume.cpp",
159 ],
160 static_libs: [
161 "libarcvolume",
162 ],
163 },
Mark Salyzyn865086d2020-07-17 08:17:50 -0700164 debuggable: {
165 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
166 },
167 },
Yifan Hong024a1242018-08-10 13:50:46 -0700168 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700169 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900170 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800171 "libbinder_ndk",
Yifan Hong024a1242018-08-10 13:50:46 -0700172 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900173 whole_static_libs: [
174 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100175 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900176 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600177}
178
179cc_binary {
180 name: "vold",
181 defaults: [
182 "vold_default_flags",
183 "vold_default_libs",
184 ],
185
186 srcs: ["main.cpp"],
187 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700188 init_rc: [
189 "vold.rc",
190 "wait_for_keymaster.rc",
191 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600192
193 required: [
194 "mke2fs",
195 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800196 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600197 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700198
199 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700200 "android.hardware.health.storage@1.0",
Jeongik Cha89253242021-01-26 22:35:14 +0900201 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800202 "libbinder_ndk",
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
221 srcs: ["vdc.cpp"],
222 shared_libs: [
223 "libbase",
224 "libbinder",
225 "libcutils",
226 "libutils",
227 ],
228 static_libs: [
229 "libvold_binder",
230 ],
231 init_rc: ["vdc.rc"],
232}
233
234cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800235 name: "wait_for_keymaster",
236 defaults: ["vold_default_flags"],
237
238 srcs: [
239 "wait_for_keymaster.cpp",
240 "Keymaster.cpp",
241 ],
242 shared_libs: [
243 "libbase",
244 "libbinder",
245
246 "android.hardware.keymaster@3.0",
247 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700248 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800249 "libhardware",
250 "libhardware_legacy",
251 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800252 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700253 "libkeymaster4_1support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700254 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800255 ],
256}
257
258cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600259 name: "secdiscard",
260 defaults: ["vold_default_flags"],
261
262 srcs: [
263 "FileDeviceUtils.cpp",
264 "secdiscard.cpp",
265 ],
266 shared_libs: ["libbase"],
267}
268
269cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600270 name: "vold_prepare_subdirs",
271 defaults: ["vold_default_flags"],
272
Paul Crowley82b41ff2017-10-20 08:17:54 -0700273 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
274 shared_libs: [
275 "libbase",
276 "libcutils",
277 "liblogwrap",
278 "libselinux",
279 "libutils",
280 ],
281 static_libs: [
282 "libvold_binder",
283 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600284}
285
Colin Crossa8388632017-11-25 08:47:19 -0800286filegroup {
287 name: "vold_aidl",
288 srcs: [
289 "binder/android/os/IVold.aidl",
290 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000291 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800292 "binder/android/os/IVoldTaskListener.aidl",
293 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700294 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800295}