blob: e958531ad09c520bfa90526fc0dce070161eb956 [file] [log] [blame]
Jeff Sharkeyd16dc502017-10-23 14:38:55 -06001cc_defaults {
2 name: "vold_default_flags",
3
4 cflags: [
5 "-Wall",
6 "-Werror",
7 "-Wextra",
8 "-Wno-missing-field-initializers",
9 "-Wno-unused-parameter",
10 "-Wno-unused-variable",
11 ],
12
13 clang: true,
14
15 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",
40 "libscrypt_static",
41 "libsquashfs_utils",
42 "libvold_binder",
43 ],
44 shared_libs: [
45 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070046 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070047 "android.hardware.keymaster@4.1",
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",
Shawn Willden35351812018-01-22 09:08:32 -070062 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070063 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060064 "libkeyutils",
65 "liblog",
66 "liblogwrap",
67 "libselinux",
68 "libsysutils",
69 "libutils",
70 ],
71}
72
73cc_library_static {
74 name: "libvold_binder",
75 defaults: ["vold_default_flags"],
76
77 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080078 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060079 ],
80 shared_libs: [
81 "libbinder",
82 "libutils",
83 ],
84 aidl: {
85 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080086 include_dirs: [
87 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090088 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080089 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060090 export_aidl_headers: true,
91 },
Songchun Fanab55cec2019-12-02 10:50:12 -080092 whole_static_libs: [
Jeongik Cha89253242021-01-26 22:35:14 +090093 "libincremental_aidl-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080094 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060095}
96
Risanaedae612017-11-27 18:01:35 +090097cc_library_headers {
98 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070099 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +0900100 export_include_dirs: ["."],
101}
102
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600103// Static library factored out to support testing
104cc_library_static {
105 name: "libvold",
106 defaults: [
107 "vold_default_flags",
108 "vold_default_libs",
109 ],
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 "Devmapper.cpp",
117 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600118 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700119 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600120 "IdleMaint.cpp",
121 "KeyBuffer.cpp",
122 "KeyStorage.cpp",
123 "KeyUtil.cpp",
124 "Keymaster.cpp",
125 "Loop.cpp",
126 "MetadataCrypt.cpp",
127 "MoveStorage.cpp",
128 "NetlinkHandler.cpp",
129 "NetlinkManager.cpp",
130 "Process.cpp",
131 "ScryptParameters.cpp",
132 "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",
Jeongik Cha89253242021-01-26 22:35:14 +0900166 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800167 "libbinder_ndk",
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",
180 ],
181
182 srcs: ["main.cpp"],
183 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700184 init_rc: [
185 "vold.rc",
186 "wait_for_keymaster.rc",
187 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600188
189 required: [
190 "mke2fs",
191 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800192 "wait_for_keymaster",
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",
Jeongik Cha89253242021-01-26 22:35:14 +0900197 "android.hardware.health.storage-V1-ndk_platform",
Yifan Honge1e49452021-01-13 17:27:42 -0800198 "libbinder_ndk",
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 },
210 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600211}
212
213cc_binary {
214 name: "vdc",
215 defaults: ["vold_default_flags"],
216
217 srcs: ["vdc.cpp"],
218 shared_libs: [
219 "libbase",
220 "libbinder",
221 "libcutils",
222 "libutils",
223 ],
224 static_libs: [
225 "libvold_binder",
226 ],
227 init_rc: ["vdc.rc"],
228}
229
230cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800231 name: "wait_for_keymaster",
232 defaults: ["vold_default_flags"],
233
234 srcs: [
235 "wait_for_keymaster.cpp",
236 "Keymaster.cpp",
237 ],
238 shared_libs: [
239 "libbase",
240 "libbinder",
241
242 "android.hardware.keymaster@3.0",
243 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700244 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800245 "libhardware",
246 "libhardware_legacy",
247 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800248 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700249 "libkeymaster4_1support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700250 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800251 ],
252}
253
254cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600255 name: "secdiscard",
256 defaults: ["vold_default_flags"],
257
258 srcs: [
259 "FileDeviceUtils.cpp",
260 "secdiscard.cpp",
261 ],
262 shared_libs: ["libbase"],
263}
264
265cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600266 name: "vold_prepare_subdirs",
267 defaults: ["vold_default_flags"],
268
Paul Crowley82b41ff2017-10-20 08:17:54 -0700269 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
270 shared_libs: [
271 "libbase",
272 "libcutils",
273 "liblogwrap",
274 "libselinux",
275 "libutils",
276 ],
277 static_libs: [
278 "libvold_binder",
279 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600280}
281
Colin Crossa8388632017-11-25 08:47:19 -0800282filegroup {
283 name: "vold_aidl",
284 srcs: [
285 "binder/android/os/IVold.aidl",
286 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000287 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800288 "binder/android/os/IVoldTaskListener.aidl",
289 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700290 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800291}