blob: 8d88e5f0a144e01a9836d9c3c1ae82ae308e2001 [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",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070046 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060047 "libbase",
48 "libbinder",
49 "libcrypto",
50 "libcrypto_utils",
51 "libcutils",
52 "libdiskconfig",
53 "libext4_utils",
54 "libf2fs_sparseblock",
55 "libhardware",
56 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080057 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060058 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070059 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libkeyutils",
61 "liblog",
62 "liblogwrap",
63 "libselinux",
64 "libsysutils",
65 "libutils",
66 ],
67}
68
69cc_library_static {
70 name: "libvold_binder",
71 defaults: ["vold_default_flags"],
72
73 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080074 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060075 ],
76 shared_libs: [
77 "libbinder",
78 "libutils",
79 ],
80 aidl: {
81 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080082 include_dirs: [
83 "frameworks/native/aidl/binder",
84 "frameworks/base/core/java/android/os/incremental",
85 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060086 export_aidl_headers: true,
87 },
Songchun Fanab55cec2019-12-02 10:50:12 -080088 whole_static_libs: [
89 "libincremental_aidl-cpp",
90 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060091}
92
Risanaedae612017-11-27 18:01:35 +090093cc_library_headers {
94 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070095 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090096 export_include_dirs: ["."],
97}
98
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060099// Static library factored out to support testing
100cc_library_static {
101 name: "libvold",
102 defaults: [
103 "vold_default_flags",
104 "vold_default_libs",
105 ],
106
107 srcs: [
Risanac02a482018-10-31 21:59:47 -0600108 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600109 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600110 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700111 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600112 "Devmapper.cpp",
113 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600114 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700115 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600116 "IdleMaint.cpp",
117 "KeyBuffer.cpp",
118 "KeyStorage.cpp",
119 "KeyUtil.cpp",
120 "Keymaster.cpp",
121 "Loop.cpp",
122 "MetadataCrypt.cpp",
123 "MoveStorage.cpp",
124 "NetlinkHandler.cpp",
125 "NetlinkManager.cpp",
126 "Process.cpp",
127 "ScryptParameters.cpp",
128 "Utils.cpp",
129 "VoldNativeService.cpp",
130 "VoldUtil.cpp",
131 "VolumeManager.cpp",
132 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900133 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600134 "fs/Ext4.cpp",
135 "fs/F2fs.cpp",
136 "fs/Vfat.cpp",
137 "model/Disk.cpp",
138 "model/EmulatedVolume.cpp",
139 "model/ObbVolume.cpp",
140 "model/PrivateVolume.cpp",
141 "model/PublicVolume.cpp",
142 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900143 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600144 ],
Risanaedae612017-11-27 18:01:35 +0900145 product_variables: {
146 arc: {
147 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900148 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900149 "model/ObbVolume.cpp",
150 ],
151 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900152 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900153 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900154 "libarcobbvolume",
155 ],
156 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700157 debuggable: {
158 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
159 },
Risanaedae612017-11-27 18:01:35 +0900160 },
Yifan Hong024a1242018-08-10 13:50:46 -0700161 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700162 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700163 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900164 whole_static_libs: [
165 "com.android.sysprop.apex",
166 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600167}
168
169cc_binary {
170 name: "vold",
171 defaults: [
172 "vold_default_flags",
173 "vold_default_libs",
174 ],
175
176 srcs: ["main.cpp"],
177 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900178 product_variables: {
179 arc: {
180 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900181 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900182 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900183 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900184 ],
Risanaedae612017-11-27 18:01:35 +0900185 },
186 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700187 init_rc: [
188 "vold.rc",
189 "wait_for_keymaster.rc",
190 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600191
192 required: [
193 "mke2fs",
194 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800195 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600196 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700197
198 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700199 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700200 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600201}
202
203cc_binary {
204 name: "vdc",
205 defaults: ["vold_default_flags"],
206
207 srcs: ["vdc.cpp"],
208 shared_libs: [
209 "libbase",
210 "libbinder",
211 "libcutils",
212 "libutils",
213 ],
214 static_libs: [
215 "libvold_binder",
216 ],
217 init_rc: ["vdc.rc"],
218}
219
220cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800221 name: "wait_for_keymaster",
222 defaults: ["vold_default_flags"],
223
224 srcs: [
225 "wait_for_keymaster.cpp",
226 "Keymaster.cpp",
227 ],
228 shared_libs: [
229 "libbase",
230 "libbinder",
231
232 "android.hardware.keymaster@3.0",
233 "android.hardware.keymaster@4.0",
234 "libhardware",
235 "libhardware_legacy",
236 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800237 "libkeymaster4support",
238 ],
239}
240
241cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600242 name: "secdiscard",
243 defaults: ["vold_default_flags"],
244
245 srcs: [
246 "FileDeviceUtils.cpp",
247 "secdiscard.cpp",
248 ],
249 shared_libs: ["libbase"],
250}
251
252cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600253 name: "vold_prepare_subdirs",
254 defaults: ["vold_default_flags"],
255
Paul Crowley82b41ff2017-10-20 08:17:54 -0700256 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
257 shared_libs: [
258 "libbase",
259 "libcutils",
260 "liblogwrap",
261 "libselinux",
262 "libutils",
263 ],
264 static_libs: [
265 "libvold_binder",
266 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600267}
268
Colin Crossa8388632017-11-25 08:47:19 -0800269filegroup {
270 name: "vold_aidl",
271 srcs: [
272 "binder/android/os/IVold.aidl",
273 "binder/android/os/IVoldListener.aidl",
274 "binder/android/os/IVoldTaskListener.aidl",
275 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700276 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800277}