blob: 1e457270a3b807c85c32d2993b81b075dfca429e [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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060042 "libbase",
43 "libbinder",
44 "libcrypto",
45 "libcrypto_utils",
46 "libcutils",
47 "libdiskconfig",
48 "libext4_utils",
49 "libf2fs_sparseblock",
50 "libhardware",
51 "libhardware_legacy",
52 "libhidlbase",
53 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070054 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060055 "libkeyutils",
56 "liblog",
57 "liblogwrap",
58 "libselinux",
59 "libsysutils",
60 "libutils",
61 ],
62}
63
64cc_library_static {
65 name: "libvold_binder",
66 defaults: ["vold_default_flags"],
67
68 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080069 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060070 ],
71 shared_libs: [
72 "libbinder",
73 "libutils",
74 ],
75 aidl: {
76 local_include_dirs: ["binder"],
77 include_dirs: ["frameworks/native/aidl/binder"],
78 export_aidl_headers: true,
79 },
80}
81
Risanaedae612017-11-27 18:01:35 +090082cc_library_headers {
83 name: "libvold_headers",
84 export_include_dirs: ["."],
85}
86
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060087// Static library factored out to support testing
88cc_library_static {
89 name: "libvold",
90 defaults: [
91 "vold_default_flags",
92 "vold_default_libs",
93 ],
94
95 srcs: [
96 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -060097 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -070098 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060099 "Devmapper.cpp",
100 "EncryptInplace.cpp",
101 "Ext4Crypt.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600102 "FileDeviceUtils.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600103 "IdleMaint.cpp",
104 "KeyBuffer.cpp",
105 "KeyStorage.cpp",
106 "KeyUtil.cpp",
107 "Keymaster.cpp",
108 "Loop.cpp",
109 "MetadataCrypt.cpp",
110 "MoveStorage.cpp",
111 "NetlinkHandler.cpp",
112 "NetlinkManager.cpp",
113 "Process.cpp",
114 "ScryptParameters.cpp",
115 "Utils.cpp",
116 "VoldNativeService.cpp",
117 "VoldUtil.cpp",
118 "VolumeManager.cpp",
119 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900120 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600121 "fs/Ext4.cpp",
122 "fs/F2fs.cpp",
123 "fs/Vfat.cpp",
124 "model/Disk.cpp",
125 "model/EmulatedVolume.cpp",
126 "model/ObbVolume.cpp",
127 "model/PrivateVolume.cpp",
128 "model/PublicVolume.cpp",
129 "model/VolumeBase.cpp",
130 "secontext.cpp",
131 ],
Risanaedae612017-11-27 18:01:35 +0900132 product_variables: {
133 arc: {
134 exclude_srcs: [
135 "model/ObbVolume.cpp",
136 ],
137 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900138 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900139 "libarcobbvolume",
140 ],
141 },
142 },
Yifan Hong024a1242018-08-10 13:50:46 -0700143 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700144 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700145 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600146}
147
148cc_binary {
149 name: "vold",
150 defaults: [
151 "vold_default_flags",
152 "vold_default_libs",
153 ],
154
155 srcs: ["main.cpp"],
156 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900157 product_variables: {
158 arc: {
159 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900160 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900161 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900162 ],
Risanaedae612017-11-27 18:01:35 +0900163 },
164 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700165 init_rc: [
166 "vold.rc",
167 "wait_for_keymaster.rc",
168 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600169
170 required: [
171 "mke2fs",
172 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800173 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600174 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700175
176 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700177 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700178 "libhidltransport",
179 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600180}
181
182cc_binary {
183 name: "vdc",
184 defaults: ["vold_default_flags"],
185
186 srcs: ["vdc.cpp"],
187 shared_libs: [
188 "libbase",
189 "libbinder",
190 "libcutils",
191 "libutils",
192 ],
193 static_libs: [
194 "libvold_binder",
195 ],
196 init_rc: ["vdc.rc"],
197}
198
199cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800200 name: "wait_for_keymaster",
201 defaults: ["vold_default_flags"],
202
203 srcs: [
204 "wait_for_keymaster.cpp",
205 "Keymaster.cpp",
206 ],
207 shared_libs: [
208 "libbase",
209 "libbinder",
210
211 "android.hardware.keymaster@3.0",
212 "android.hardware.keymaster@4.0",
213 "libhardware",
214 "libhardware_legacy",
215 "libhidlbase",
216 "libhwbinder",
217 "libkeymaster4support",
218 ],
219}
220
221cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600222 name: "secdiscard",
223 defaults: ["vold_default_flags"],
224
225 srcs: [
226 "FileDeviceUtils.cpp",
227 "secdiscard.cpp",
228 ],
229 shared_libs: ["libbase"],
230}
231
232cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600233 name: "vold_prepare_subdirs",
234 defaults: ["vold_default_flags"],
235
Paul Crowley82b41ff2017-10-20 08:17:54 -0700236 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
237 shared_libs: [
238 "libbase",
239 "libcutils",
240 "liblogwrap",
241 "libselinux",
242 "libutils",
243 ],
244 static_libs: [
245 "libvold_binder",
246 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600247}
248
Colin Crossa8388632017-11-25 08:47:19 -0800249filegroup {
250 name: "vold_aidl",
251 srcs: [
252 "binder/android/os/IVold.aidl",
253 "binder/android/os/IVoldListener.aidl",
254 "binder/android/os/IVoldTaskListener.aidl",
255 ],
256}
257
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600258subdirs = ["tests"]