blob: 03dde1e541ee4a4bcd466235b26b6c6d1edc783b [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",
57 "libhardware",
58 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080059 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070061 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070062 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060063 "libkeyutils",
64 "liblog",
65 "liblogwrap",
66 "libselinux",
67 "libsysutils",
68 "libutils",
69 ],
70}
71
72cc_library_static {
73 name: "libvold_binder",
74 defaults: ["vold_default_flags"],
75
76 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080077 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060078 ],
79 shared_libs: [
80 "libbinder",
81 "libutils",
82 ],
83 aidl: {
84 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080085 include_dirs: [
86 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090087 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080088 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060089 export_aidl_headers: true,
90 },
Songchun Fanab55cec2019-12-02 10:50:12 -080091 whole_static_libs: [
92 "libincremental_aidl-cpp",
93 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060094}
95
Risanaedae612017-11-27 18:01:35 +090096cc_library_headers {
97 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070098 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090099 export_include_dirs: ["."],
100}
101
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102// Static library factored out to support testing
103cc_library_static {
104 name: "libvold",
105 defaults: [
106 "vold_default_flags",
107 "vold_default_libs",
108 ],
109
110 srcs: [
Risanac02a482018-10-31 21:59:47 -0600111 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600112 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600113 "CheckEncryption.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 ],
Risanaedae612017-11-27 18:01:35 +0900151 product_variables: {
152 arc: {
153 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900154 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900155 "model/ObbVolume.cpp",
156 ],
157 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900158 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900159 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900160 "libarcobbvolume",
161 ],
162 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700163 debuggable: {
164 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
165 },
Risanaedae612017-11-27 18:01:35 +0900166 },
Yifan Hong024a1242018-08-10 13:50:46 -0700167 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700168 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700169 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900170 whole_static_libs: [
171 "com.android.sysprop.apex",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100172 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900173 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600174}
175
176cc_binary {
177 name: "vold",
178 defaults: [
179 "vold_default_flags",
180 "vold_default_libs",
181 ],
182
183 srcs: ["main.cpp"],
184 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900185 product_variables: {
186 arc: {
187 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900188 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900189 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900190 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900191 ],
Risanaedae612017-11-27 18:01:35 +0900192 },
193 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700194 init_rc: [
195 "vold.rc",
196 "wait_for_keymaster.rc",
197 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600198
199 required: [
200 "mke2fs",
201 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800202 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600203 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700204
205 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700206 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700207 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600208}
209
210cc_binary {
211 name: "vdc",
212 defaults: ["vold_default_flags"],
213
214 srcs: ["vdc.cpp"],
215 shared_libs: [
216 "libbase",
217 "libbinder",
218 "libcutils",
219 "libutils",
220 ],
221 static_libs: [
222 "libvold_binder",
223 ],
224 init_rc: ["vdc.rc"],
225}
226
227cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800228 name: "wait_for_keymaster",
229 defaults: ["vold_default_flags"],
230
231 srcs: [
232 "wait_for_keymaster.cpp",
233 "Keymaster.cpp",
234 ],
235 shared_libs: [
236 "libbase",
237 "libbinder",
238
239 "android.hardware.keymaster@3.0",
240 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700241 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800242 "libhardware",
243 "libhardware_legacy",
244 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800245 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700246 "libkeymaster4_1support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700247 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800248 ],
249}
250
251cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600252 name: "secdiscard",
253 defaults: ["vold_default_flags"],
254
255 srcs: [
256 "FileDeviceUtils.cpp",
257 "secdiscard.cpp",
258 ],
259 shared_libs: ["libbase"],
260}
261
262cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600263 name: "vold_prepare_subdirs",
264 defaults: ["vold_default_flags"],
265
Paul Crowley82b41ff2017-10-20 08:17:54 -0700266 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
267 shared_libs: [
268 "libbase",
269 "libcutils",
270 "liblogwrap",
271 "libselinux",
272 "libutils",
273 ],
274 static_libs: [
275 "libvold_binder",
276 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600277}
278
Colin Crossa8388632017-11-25 08:47:19 -0800279filegroup {
280 name: "vold_aidl",
281 srcs: [
282 "binder/android/os/IVold.aidl",
283 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000284 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800285 "binder/android/os/IVoldTaskListener.aidl",
286 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700287 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800288}