blob: 87c31ec5b758ac181f2932c32795c15c192b2429 [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",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080034 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060035 "libfs_mgr",
36 "libscrypt_static",
37 "libsquashfs_utils",
38 "libvold_binder",
39 ],
40 shared_libs: [
41 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070042 "android.hardware.keymaster@4.0",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070043 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060044 "libbase",
45 "libbinder",
46 "libcrypto",
47 "libcrypto_utils",
48 "libcutils",
49 "libdiskconfig",
50 "libext4_utils",
51 "libf2fs_sparseblock",
Eric Biggersa701c452018-10-23 13:06:55 -070052 "libfscrypt",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060053 "libhardware",
54 "libhardware_legacy",
55 "libhidlbase",
56 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070057 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060058 "libkeyutils",
59 "liblog",
60 "liblogwrap",
61 "libselinux",
62 "libsysutils",
63 "libutils",
64 ],
65}
66
67cc_library_static {
68 name: "libvold_binder",
69 defaults: ["vold_default_flags"],
70
71 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080072 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060073 ],
74 shared_libs: [
75 "libbinder",
76 "libutils",
77 ],
78 aidl: {
79 local_include_dirs: ["binder"],
80 include_dirs: ["frameworks/native/aidl/binder"],
81 export_aidl_headers: true,
82 },
83}
84
Risanaedae612017-11-27 18:01:35 +090085cc_library_headers {
86 name: "libvold_headers",
87 export_include_dirs: ["."],
88}
89
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060090// Static library factored out to support testing
91cc_library_static {
92 name: "libvold",
93 defaults: [
94 "vold_default_flags",
95 "vold_default_libs",
96 ],
97
98 srcs: [
99 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600100 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700101 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102 "Devmapper.cpp",
103 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600104 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700105 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600106 "IdleMaint.cpp",
107 "KeyBuffer.cpp",
108 "KeyStorage.cpp",
109 "KeyUtil.cpp",
110 "Keymaster.cpp",
111 "Loop.cpp",
112 "MetadataCrypt.cpp",
113 "MoveStorage.cpp",
114 "NetlinkHandler.cpp",
115 "NetlinkManager.cpp",
116 "Process.cpp",
117 "ScryptParameters.cpp",
118 "Utils.cpp",
119 "VoldNativeService.cpp",
120 "VoldUtil.cpp",
121 "VolumeManager.cpp",
122 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900123 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600124 "fs/Ext4.cpp",
125 "fs/F2fs.cpp",
126 "fs/Vfat.cpp",
127 "model/Disk.cpp",
128 "model/EmulatedVolume.cpp",
129 "model/ObbVolume.cpp",
130 "model/PrivateVolume.cpp",
131 "model/PublicVolume.cpp",
132 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900133 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600134 "secontext.cpp",
135 ],
Risanaedae612017-11-27 18:01:35 +0900136 product_variables: {
137 arc: {
138 exclude_srcs: [
139 "model/ObbVolume.cpp",
140 ],
141 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900142 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900143 "libarcobbvolume",
144 ],
145 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700146 debuggable: {
147 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
148 },
Risanaedae612017-11-27 18:01:35 +0900149 },
Yifan Hong024a1242018-08-10 13:50:46 -0700150 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700151 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700152 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600153}
154
155cc_binary {
156 name: "vold",
157 defaults: [
158 "vold_default_flags",
159 "vold_default_libs",
160 ],
161
162 srcs: ["main.cpp"],
163 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900164 product_variables: {
165 arc: {
166 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900167 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900168 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900169 ],
Risanaedae612017-11-27 18:01:35 +0900170 },
171 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700172 init_rc: [
173 "vold.rc",
174 "wait_for_keymaster.rc",
175 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600176
177 required: [
178 "mke2fs",
179 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800180 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600181 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700182
183 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700184 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700185 "libhidltransport",
186 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600187}
188
189cc_binary {
190 name: "vdc",
191 defaults: ["vold_default_flags"],
192
193 srcs: ["vdc.cpp"],
194 shared_libs: [
195 "libbase",
196 "libbinder",
197 "libcutils",
198 "libutils",
199 ],
200 static_libs: [
201 "libvold_binder",
202 ],
203 init_rc: ["vdc.rc"],
204}
205
206cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800207 name: "wait_for_keymaster",
208 defaults: ["vold_default_flags"],
209
210 srcs: [
211 "wait_for_keymaster.cpp",
212 "Keymaster.cpp",
213 ],
214 shared_libs: [
215 "libbase",
216 "libbinder",
217
218 "android.hardware.keymaster@3.0",
219 "android.hardware.keymaster@4.0",
220 "libhardware",
221 "libhardware_legacy",
222 "libhidlbase",
223 "libhwbinder",
224 "libkeymaster4support",
225 ],
226}
227
228cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600229 name: "secdiscard",
230 defaults: ["vold_default_flags"],
231
232 srcs: [
233 "FileDeviceUtils.cpp",
234 "secdiscard.cpp",
235 ],
236 shared_libs: ["libbase"],
237}
238
239cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600240 name: "vold_prepare_subdirs",
241 defaults: ["vold_default_flags"],
242
Paul Crowley82b41ff2017-10-20 08:17:54 -0700243 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
244 shared_libs: [
245 "libbase",
246 "libcutils",
247 "liblogwrap",
248 "libselinux",
249 "libutils",
250 ],
251 static_libs: [
252 "libvold_binder",
253 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600254}
255
Colin Crossa8388632017-11-25 08:47:19 -0800256filegroup {
257 name: "vold_aidl",
258 srcs: [
259 "binder/android/os/IVold.aidl",
260 "binder/android/os/IVoldListener.aidl",
261 "binder/android/os/IVoldTaskListener.aidl",
262 ],
263}
264
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600265subdirs = ["tests"]