blob: 1045dc23fd6824362492e355c88b5e8f5af7da17 [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: [
31 "libavb",
32 "libbootloader_message",
33 "libfec",
34 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080035 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060036 "libfs_mgr",
37 "libscrypt_static",
38 "libsquashfs_utils",
39 "libvold_binder",
40 ],
41 shared_libs: [
42 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070043 "android.hardware.keymaster@4.0",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070044 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060045 "libbase",
46 "libbinder",
47 "libcrypto",
48 "libcrypto_utils",
49 "libcutils",
50 "libdiskconfig",
51 "libext4_utils",
52 "libf2fs_sparseblock",
Eric Biggersa701c452018-10-23 13:06:55 -070053 "libfscrypt",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060054 "libhardware",
55 "libhardware_legacy",
56 "libhidlbase",
57 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070058 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060059 "libkeyutils",
60 "liblog",
61 "liblogwrap",
62 "libselinux",
63 "libsysutils",
64 "libutils",
65 ],
66}
67
68cc_library_static {
69 name: "libvold_binder",
70 defaults: ["vold_default_flags"],
71
72 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080073 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060074 ],
75 shared_libs: [
76 "libbinder",
77 "libutils",
78 ],
79 aidl: {
80 local_include_dirs: ["binder"],
81 include_dirs: ["frameworks/native/aidl/binder"],
82 export_aidl_headers: true,
83 },
84}
85
Risanaedae612017-11-27 18:01:35 +090086cc_library_headers {
87 name: "libvold_headers",
88 export_include_dirs: ["."],
89}
90
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060091// Static library factored out to support testing
92cc_library_static {
93 name: "libvold",
94 defaults: [
95 "vold_default_flags",
96 "vold_default_libs",
97 ],
98
99 srcs: [
Risanac02a482018-10-31 21:59:47 -0600100 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600101 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600102 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700103 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600104 "Devmapper.cpp",
105 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600106 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700107 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600108 "IdleMaint.cpp",
109 "KeyBuffer.cpp",
110 "KeyStorage.cpp",
111 "KeyUtil.cpp",
112 "Keymaster.cpp",
113 "Loop.cpp",
114 "MetadataCrypt.cpp",
115 "MoveStorage.cpp",
116 "NetlinkHandler.cpp",
117 "NetlinkManager.cpp",
118 "Process.cpp",
119 "ScryptParameters.cpp",
120 "Utils.cpp",
121 "VoldNativeService.cpp",
122 "VoldUtil.cpp",
123 "VolumeManager.cpp",
124 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900125 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600126 "fs/Ext4.cpp",
127 "fs/F2fs.cpp",
128 "fs/Vfat.cpp",
129 "model/Disk.cpp",
130 "model/EmulatedVolume.cpp",
131 "model/ObbVolume.cpp",
132 "model/PrivateVolume.cpp",
133 "model/PublicVolume.cpp",
134 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900135 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600136 ],
Risanaedae612017-11-27 18:01:35 +0900137 product_variables: {
138 arc: {
139 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900140 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900141 "model/ObbVolume.cpp",
142 ],
143 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900144 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900145 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900146 "libarcobbvolume",
147 ],
148 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700149 debuggable: {
150 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
151 },
Risanaedae612017-11-27 18:01:35 +0900152 },
Yifan Hong024a1242018-08-10 13:50:46 -0700153 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700154 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700155 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900156 whole_static_libs: [
157 "com.android.sysprop.apex",
158 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600159}
160
161cc_binary {
162 name: "vold",
163 defaults: [
164 "vold_default_flags",
165 "vold_default_libs",
166 ],
167
168 srcs: ["main.cpp"],
169 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900170 product_variables: {
171 arc: {
172 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900173 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900174 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900175 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900176 ],
Risanaedae612017-11-27 18:01:35 +0900177 },
178 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700179 init_rc: [
180 "vold.rc",
181 "wait_for_keymaster.rc",
182 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600183
184 required: [
185 "mke2fs",
186 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800187 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600188 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700189
190 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700191 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700192 "libhidltransport",
193 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600194}
195
196cc_binary {
197 name: "vdc",
198 defaults: ["vold_default_flags"],
199
200 srcs: ["vdc.cpp"],
201 shared_libs: [
202 "libbase",
203 "libbinder",
204 "libcutils",
205 "libutils",
206 ],
207 static_libs: [
208 "libvold_binder",
209 ],
210 init_rc: ["vdc.rc"],
211}
212
213cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800214 name: "wait_for_keymaster",
215 defaults: ["vold_default_flags"],
216
217 srcs: [
218 "wait_for_keymaster.cpp",
219 "Keymaster.cpp",
220 ],
221 shared_libs: [
222 "libbase",
223 "libbinder",
224
225 "android.hardware.keymaster@3.0",
226 "android.hardware.keymaster@4.0",
227 "libhardware",
228 "libhardware_legacy",
229 "libhidlbase",
230 "libhwbinder",
231 "libkeymaster4support",
232 ],
233}
234
235cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600236 name: "secdiscard",
237 defaults: ["vold_default_flags"],
238
239 srcs: [
240 "FileDeviceUtils.cpp",
241 "secdiscard.cpp",
242 ],
243 shared_libs: ["libbase"],
244}
245
246cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600247 name: "vold_prepare_subdirs",
248 defaults: ["vold_default_flags"],
249
Paul Crowley82b41ff2017-10-20 08:17:54 -0700250 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
251 shared_libs: [
252 "libbase",
253 "libcutils",
254 "liblogwrap",
255 "libselinux",
256 "libutils",
257 ],
258 static_libs: [
259 "libvold_binder",
260 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600261}
262
Colin Crossa8388632017-11-25 08:47:19 -0800263filegroup {
264 name: "vold_aidl",
265 srcs: [
266 "binder/android/os/IVold.aidl",
267 "binder/android/os/IVoldListener.aidl",
268 "binder/android/os/IVoldTaskListener.aidl",
269 ],
270}
271
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600272subdirs = ["tests"]