blob: b115bc1516f6edfb05d760a7f95d11689cc641dd [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 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700142 debuggable: {
143 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
144 },
Risanaedae612017-11-27 18:01:35 +0900145 },
Yifan Hong024a1242018-08-10 13:50:46 -0700146 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700147 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700148 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600149}
150
151cc_binary {
152 name: "vold",
153 defaults: [
154 "vold_default_flags",
155 "vold_default_libs",
156 ],
157
158 srcs: ["main.cpp"],
159 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900160 product_variables: {
161 arc: {
162 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900163 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900164 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900165 ],
Risanaedae612017-11-27 18:01:35 +0900166 },
167 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700168 init_rc: [
169 "vold.rc",
170 "wait_for_keymaster.rc",
171 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600172
173 required: [
174 "mke2fs",
175 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800176 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600177 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700178
179 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700180 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700181 "libhidltransport",
182 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600183}
184
185cc_binary {
186 name: "vdc",
187 defaults: ["vold_default_flags"],
188
189 srcs: ["vdc.cpp"],
190 shared_libs: [
191 "libbase",
192 "libbinder",
193 "libcutils",
194 "libutils",
195 ],
196 static_libs: [
197 "libvold_binder",
198 ],
199 init_rc: ["vdc.rc"],
200}
201
202cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800203 name: "wait_for_keymaster",
204 defaults: ["vold_default_flags"],
205
206 srcs: [
207 "wait_for_keymaster.cpp",
208 "Keymaster.cpp",
209 ],
210 shared_libs: [
211 "libbase",
212 "libbinder",
213
214 "android.hardware.keymaster@3.0",
215 "android.hardware.keymaster@4.0",
216 "libhardware",
217 "libhardware_legacy",
218 "libhidlbase",
219 "libhwbinder",
220 "libkeymaster4support",
221 ],
222}
223
224cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600225 name: "secdiscard",
226 defaults: ["vold_default_flags"],
227
228 srcs: [
229 "FileDeviceUtils.cpp",
230 "secdiscard.cpp",
231 ],
232 shared_libs: ["libbase"],
233}
234
235cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600236 name: "vold_prepare_subdirs",
237 defaults: ["vold_default_flags"],
238
Paul Crowley82b41ff2017-10-20 08:17:54 -0700239 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
240 shared_libs: [
241 "libbase",
242 "libcutils",
243 "liblogwrap",
244 "libselinux",
245 "libutils",
246 ],
247 static_libs: [
248 "libvold_binder",
249 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600250}
251
Colin Crossa8388632017-11-25 08:47:19 -0800252filegroup {
253 name: "vold_aidl",
254 srcs: [
255 "binder/android/os/IVold.aidl",
256 "binder/android/os/IVoldListener.aidl",
257 "binder/android/os/IVoldTaskListener.aidl",
258 ],
259}
260
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600261subdirs = ["tests"]