blob: e1877b9e61c58bf076959974a92959cd8c4b9fa7 [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",
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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060061 "libkeyutils",
62 "liblog",
63 "liblogwrap",
64 "libselinux",
65 "libsysutils",
66 "libutils",
67 ],
68}
69
70cc_library_static {
71 name: "libvold_binder",
72 defaults: ["vold_default_flags"],
73
74 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080075 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060076 ],
77 shared_libs: [
78 "libbinder",
79 "libutils",
80 ],
81 aidl: {
82 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080083 include_dirs: [
84 "frameworks/native/aidl/binder",
85 "frameworks/base/core/java/android/os/incremental",
86 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060087 export_aidl_headers: true,
88 },
Songchun Fanab55cec2019-12-02 10:50:12 -080089 whole_static_libs: [
90 "libincremental_aidl-cpp",
91 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060092}
93
Risanaedae612017-11-27 18:01:35 +090094cc_library_headers {
95 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070096 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090097 export_include_dirs: ["."],
98}
99
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600100// Static library factored out to support testing
101cc_library_static {
102 name: "libvold",
103 defaults: [
104 "vold_default_flags",
105 "vold_default_libs",
106 ],
107
108 srcs: [
Risanac02a482018-10-31 21:59:47 -0600109 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600110 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600111 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700112 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600113 "Devmapper.cpp",
114 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600115 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700116 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600117 "IdleMaint.cpp",
118 "KeyBuffer.cpp",
119 "KeyStorage.cpp",
120 "KeyUtil.cpp",
121 "Keymaster.cpp",
122 "Loop.cpp",
123 "MetadataCrypt.cpp",
124 "MoveStorage.cpp",
125 "NetlinkHandler.cpp",
126 "NetlinkManager.cpp",
127 "Process.cpp",
128 "ScryptParameters.cpp",
129 "Utils.cpp",
130 "VoldNativeService.cpp",
131 "VoldUtil.cpp",
132 "VolumeManager.cpp",
133 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900134 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600135 "fs/Ext4.cpp",
136 "fs/F2fs.cpp",
137 "fs/Vfat.cpp",
138 "model/Disk.cpp",
139 "model/EmulatedVolume.cpp",
140 "model/ObbVolume.cpp",
141 "model/PrivateVolume.cpp",
142 "model/PublicVolume.cpp",
143 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900144 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600145 ],
Risanaedae612017-11-27 18:01:35 +0900146 product_variables: {
147 arc: {
148 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900149 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900150 "model/ObbVolume.cpp",
151 ],
152 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900153 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900154 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900155 "libarcobbvolume",
156 ],
157 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700158 debuggable: {
159 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
160 },
Risanaedae612017-11-27 18:01:35 +0900161 },
Yifan Hong024a1242018-08-10 13:50:46 -0700162 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700163 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700164 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900165 whole_static_libs: [
166 "com.android.sysprop.apex",
167 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600168}
169
170cc_binary {
171 name: "vold",
172 defaults: [
173 "vold_default_flags",
174 "vold_default_libs",
175 ],
176
177 srcs: ["main.cpp"],
178 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900179 product_variables: {
180 arc: {
181 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900182 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900183 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900184 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900185 ],
Risanaedae612017-11-27 18:01:35 +0900186 },
187 },
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",
Yifan Hong024a1242018-08-10 13:50:46 -0700201 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600202}
203
204cc_binary {
205 name: "vdc",
206 defaults: ["vold_default_flags"],
207
208 srcs: ["vdc.cpp"],
209 shared_libs: [
210 "libbase",
211 "libbinder",
212 "libcutils",
213 "libutils",
214 ],
215 static_libs: [
216 "libvold_binder",
217 ],
218 init_rc: ["vdc.rc"],
219}
220
221cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800222 name: "wait_for_keymaster",
223 defaults: ["vold_default_flags"],
224
225 srcs: [
226 "wait_for_keymaster.cpp",
227 "Keymaster.cpp",
228 ],
229 shared_libs: [
230 "libbase",
231 "libbinder",
232
233 "android.hardware.keymaster@3.0",
234 "android.hardware.keymaster@4.0",
235 "libhardware",
236 "libhardware_legacy",
237 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800238 "libkeymaster4support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700239 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800240 ],
241}
242
243cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600244 name: "secdiscard",
245 defaults: ["vold_default_flags"],
246
247 srcs: [
248 "FileDeviceUtils.cpp",
249 "secdiscard.cpp",
250 ],
251 shared_libs: ["libbase"],
252}
253
254cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600255 name: "vold_prepare_subdirs",
256 defaults: ["vold_default_flags"],
257
Paul Crowley82b41ff2017-10-20 08:17:54 -0700258 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
259 shared_libs: [
260 "libbase",
261 "libcutils",
262 "liblogwrap",
263 "libselinux",
264 "libutils",
265 ],
266 static_libs: [
267 "libvold_binder",
268 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600269}
270
Colin Crossa8388632017-11-25 08:47:19 -0800271filegroup {
272 name: "vold_aidl",
273 srcs: [
274 "binder/android/os/IVold.aidl",
275 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000276 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800277 "binder/android/os/IVoldTaskListener.aidl",
278 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700279 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800280}