blob: 0ffc8f9a5c0122edabcef46209529cc362248d0d [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: [
31 "libavb",
32 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070033 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070034 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060035 "libfec",
36 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080037 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060038 "libfs_mgr",
39 "libscrypt_static",
40 "libsquashfs_utils",
41 "libvold_binder",
42 ],
43 shared_libs: [
44 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070045 "android.hardware.keymaster@4.0",
Shawn Willden35f0f222020-01-16 13:21:42 -070046 "android.hardware.keymaster@4.1",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070047 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060048 "libbase",
49 "libbinder",
50 "libcrypto",
51 "libcrypto_utils",
52 "libcutils",
53 "libdiskconfig",
54 "libext4_utils",
55 "libf2fs_sparseblock",
56 "libhardware",
57 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080058 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060059 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070060 "libkeymaster4support",
Shawn Willden35f0f222020-01-16 13:21:42 -070061 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060062 "libkeyutils",
63 "liblog",
64 "liblogwrap",
65 "libselinux",
66 "libsysutils",
67 "libutils",
68 ],
69}
70
71cc_library_static {
72 name: "libvold_binder",
73 defaults: ["vold_default_flags"],
74
75 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080076 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060077 ],
78 shared_libs: [
79 "libbinder",
80 "libutils",
81 ],
82 aidl: {
83 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080084 include_dirs: [
85 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090086 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080087 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060088 export_aidl_headers: true,
89 },
Songchun Fanab55cec2019-12-02 10:50:12 -080090 whole_static_libs: [
91 "libincremental_aidl-cpp",
92 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060093}
94
Risanaedae612017-11-27 18:01:35 +090095cc_library_headers {
96 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070097 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090098 export_include_dirs: ["."],
99}
100
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600101// Static library factored out to support testing
102cc_library_static {
103 name: "libvold",
104 defaults: [
105 "vold_default_flags",
106 "vold_default_libs",
107 ],
108
109 srcs: [
Risanac02a482018-10-31 21:59:47 -0600110 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600111 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600112 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700113 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800114 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600115 "Devmapper.cpp",
116 "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",
123 "Keymaster.cpp",
124 "Loop.cpp",
125 "MetadataCrypt.cpp",
126 "MoveStorage.cpp",
127 "NetlinkHandler.cpp",
128 "NetlinkManager.cpp",
129 "Process.cpp",
130 "ScryptParameters.cpp",
131 "Utils.cpp",
132 "VoldNativeService.cpp",
Yurii Zubrytskyi9e7482e2020-03-24 16:23:51 -0700133 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600134 "VoldUtil.cpp",
135 "VolumeManager.cpp",
136 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900137 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600138 "fs/Ext4.cpp",
139 "fs/F2fs.cpp",
140 "fs/Vfat.cpp",
141 "model/Disk.cpp",
142 "model/EmulatedVolume.cpp",
143 "model/ObbVolume.cpp",
144 "model/PrivateVolume.cpp",
145 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900146 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800147 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800148 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600149 ],
Risanaedae612017-11-27 18:01:35 +0900150 product_variables: {
151 arc: {
152 exclude_srcs: [
153 "model/ObbVolume.cpp",
154 ],
155 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900156 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900157 "libarcobbvolume",
158 ],
159 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700160 debuggable: {
161 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
162 },
Risanaedae612017-11-27 18:01:35 +0900163 },
Yifan Hong024a1242018-08-10 13:50:46 -0700164 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700165 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700166 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900167 whole_static_libs: [
168 "com.android.sysprop.apex",
169 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600170}
171
172cc_binary {
173 name: "vold",
174 defaults: [
175 "vold_default_flags",
176 "vold_default_libs",
177 ],
178
179 srcs: ["main.cpp"],
180 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900181 product_variables: {
182 arc: {
183 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900184 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900185 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900186 ],
Risanaedae612017-11-27 18:01:35 +0900187 },
188 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700189 init_rc: [
190 "vold.rc",
191 "wait_for_keymaster.rc",
192 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600193
194 required: [
195 "mke2fs",
196 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800197 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600198 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700199
200 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700201 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700202 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600203}
204
205cc_binary {
206 name: "vdc",
207 defaults: ["vold_default_flags"],
208
209 srcs: ["vdc.cpp"],
210 shared_libs: [
211 "libbase",
212 "libbinder",
213 "libcutils",
214 "libutils",
215 ],
216 static_libs: [
217 "libvold_binder",
218 ],
219 init_rc: ["vdc.rc"],
220}
221
222cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800223 name: "wait_for_keymaster",
224 defaults: ["vold_default_flags"],
225
226 srcs: [
227 "wait_for_keymaster.cpp",
228 "Keymaster.cpp",
229 ],
230 shared_libs: [
231 "libbase",
232 "libbinder",
233
234 "android.hardware.keymaster@3.0",
235 "android.hardware.keymaster@4.0",
Shawn Willden35f0f222020-01-16 13:21:42 -0700236 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800237 "libhardware",
238 "libhardware_legacy",
239 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800240 "libkeymaster4support",
Shawn Willden35f0f222020-01-16 13:21:42 -0700241 "libkeymaster4_1support",
Paul Crowley8f828792018-02-07 14:41:26 -0800242 ],
243}
244
245cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600246 name: "secdiscard",
247 defaults: ["vold_default_flags"],
248
249 srcs: [
250 "FileDeviceUtils.cpp",
251 "secdiscard.cpp",
252 ],
253 shared_libs: ["libbase"],
254}
255
256cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600257 name: "vold_prepare_subdirs",
258 defaults: ["vold_default_flags"],
259
Paul Crowley82b41ff2017-10-20 08:17:54 -0700260 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
261 shared_libs: [
262 "libbase",
263 "libcutils",
264 "liblogwrap",
265 "libselinux",
266 "libutils",
267 ],
268 static_libs: [
269 "libvold_binder",
270 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600271}
272
Colin Crossa8388632017-11-25 08:47:19 -0800273filegroup {
274 name: "vold_aidl",
275 srcs: [
276 "binder/android/os/IVold.aidl",
277 "binder/android/os/IVoldListener.aidl",
278 "binder/android/os/IVoldTaskListener.aidl",
279 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700280 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800281}