blob: 8f2ba342b5cd92681ec53810f1770f5ced233d9e [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*",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060020 ],
21 tidy_flags: [
22 "-warnings-as-errors=clang-analyzer-security*,cert-*",
23 ],
24}
25
26cc_defaults {
27 name: "vold_default_libs",
28
29 static_libs: [
30 "libavb",
31 "libbootloader_message",
32 "libfec",
33 "libfec_rs",
34 "libfs_mgr",
35 "libscrypt_static",
36 "libsquashfs_utils",
37 "libvold_binder",
38 ],
39 shared_libs: [
40 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070041 "android.hardware.keymaster@4.0",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070042 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060043 "libbase",
44 "libbinder",
45 "libcrypto",
46 "libcrypto_utils",
47 "libcutils",
48 "libdiskconfig",
49 "libext4_utils",
50 "libf2fs_sparseblock",
Eric Biggersa701c452018-10-23 13:06:55 -070051 "libfscrypt",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060052 "libhardware",
53 "libhardware_legacy",
54 "libhidlbase",
55 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070056 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060057 "libkeyutils",
58 "liblog",
59 "liblogwrap",
60 "libselinux",
61 "libsysutils",
62 "libutils",
63 ],
64}
65
66cc_library_static {
67 name: "libvold_binder",
68 defaults: ["vold_default_flags"],
69
70 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080071 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060072 ],
73 shared_libs: [
74 "libbinder",
75 "libutils",
76 ],
77 aidl: {
78 local_include_dirs: ["binder"],
79 include_dirs: ["frameworks/native/aidl/binder"],
80 export_aidl_headers: true,
81 },
82}
83
Risanaedae612017-11-27 18:01:35 +090084cc_library_headers {
85 name: "libvold_headers",
86 export_include_dirs: ["."],
87}
88
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060089// Static library factored out to support testing
90cc_library_static {
91 name: "libvold",
92 defaults: [
93 "vold_default_flags",
94 "vold_default_libs",
95 ],
96
97 srcs: [
98 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -060099 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700100 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600101 "Devmapper.cpp",
102 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600103 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700104 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600105 "IdleMaint.cpp",
106 "KeyBuffer.cpp",
107 "KeyStorage.cpp",
108 "KeyUtil.cpp",
109 "Keymaster.cpp",
110 "Loop.cpp",
111 "MetadataCrypt.cpp",
112 "MoveStorage.cpp",
113 "NetlinkHandler.cpp",
114 "NetlinkManager.cpp",
115 "Process.cpp",
116 "ScryptParameters.cpp",
117 "Utils.cpp",
118 "VoldNativeService.cpp",
119 "VoldUtil.cpp",
120 "VolumeManager.cpp",
121 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900122 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600123 "fs/Ext4.cpp",
124 "fs/F2fs.cpp",
125 "fs/Vfat.cpp",
126 "model/Disk.cpp",
127 "model/EmulatedVolume.cpp",
128 "model/ObbVolume.cpp",
129 "model/PrivateVolume.cpp",
130 "model/PublicVolume.cpp",
131 "model/VolumeBase.cpp",
132 "secontext.cpp",
133 ],
Risanaedae612017-11-27 18:01:35 +0900134 product_variables: {
135 arc: {
136 exclude_srcs: [
137 "model/ObbVolume.cpp",
138 ],
139 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900140 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900141 "libarcobbvolume",
142 ],
143 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700144 debuggable: {
145 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
146 },
Risanaedae612017-11-27 18:01:35 +0900147 },
Yifan Hong024a1242018-08-10 13:50:46 -0700148 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700149 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700150 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600151}
152
153cc_binary {
154 name: "vold",
155 defaults: [
156 "vold_default_flags",
157 "vold_default_libs",
158 ],
159
160 srcs: ["main.cpp"],
161 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900162 product_variables: {
163 arc: {
164 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900165 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900166 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900167 ],
Risanaedae612017-11-27 18:01:35 +0900168 },
169 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700170 init_rc: [
171 "vold.rc",
172 "wait_for_keymaster.rc",
173 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600174
175 required: [
176 "mke2fs",
177 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800178 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600179 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700180
181 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700182 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700183 "libhidltransport",
184 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600185}
186
187cc_binary {
188 name: "vdc",
189 defaults: ["vold_default_flags"],
190
191 srcs: ["vdc.cpp"],
192 shared_libs: [
193 "libbase",
194 "libbinder",
195 "libcutils",
196 "libutils",
197 ],
198 static_libs: [
199 "libvold_binder",
200 ],
201 init_rc: ["vdc.rc"],
202}
203
204cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800205 name: "wait_for_keymaster",
206 defaults: ["vold_default_flags"],
207
208 srcs: [
209 "wait_for_keymaster.cpp",
210 "Keymaster.cpp",
211 ],
212 shared_libs: [
213 "libbase",
214 "libbinder",
215
216 "android.hardware.keymaster@3.0",
217 "android.hardware.keymaster@4.0",
218 "libhardware",
219 "libhardware_legacy",
220 "libhidlbase",
221 "libhwbinder",
222 "libkeymaster4support",
223 ],
224}
225
226cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600227 name: "secdiscard",
228 defaults: ["vold_default_flags"],
229
230 srcs: [
231 "FileDeviceUtils.cpp",
232 "secdiscard.cpp",
233 ],
234 shared_libs: ["libbase"],
235}
236
237cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600238 name: "vold_prepare_subdirs",
239 defaults: ["vold_default_flags"],
240
Paul Crowley82b41ff2017-10-20 08:17:54 -0700241 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
242 shared_libs: [
243 "libbase",
244 "libcutils",
245 "liblogwrap",
246 "libselinux",
247 "libutils",
248 ],
249 static_libs: [
250 "libvold_binder",
251 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600252}
253
Colin Crossa8388632017-11-25 08:47:19 -0800254filegroup {
255 name: "vold_aidl",
256 srcs: [
257 "binder/android/os/IVold.aidl",
258 "binder/android/os/IVoldListener.aidl",
259 "binder/android/os/IVoldTaskListener.aidl",
260 ],
261}
262
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600263subdirs = ["tests"]