blob: 1c800fe543860e0632cfdd6751e8778b5887c088 [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: [
Narayan Kamath02efdf52019-11-27 10:53:51 +000031 "libasync_safe",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060032 "libavb",
33 "libbootloader_message",
David Andersonb9224732019-05-13 13:02:54 -070034 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070035 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060036 "libfec",
37 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080038 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060039 "libfs_mgr",
40 "libscrypt_static",
41 "libsquashfs_utils",
42 "libvold_binder",
43 ],
44 shared_libs: [
45 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070046 "android.hardware.keymaster@4.0",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070047 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060048 "libbase",
49 "libbinder",
50 "libcrypto",
51 "libcrypto_utils",
52 "libcutils",
53 "libdiskconfig",
54 "libext4_utils",
55 "libf2fs_sparseblock",
56 "libhardware",
57 "libhardware_legacy",
58 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070059 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libkeyutils",
61 "liblog",
62 "liblogwrap",
63 "libselinux",
64 "libsysutils",
65 "libutils",
66 ],
67}
68
69cc_library_static {
70 name: "libvold_binder",
71 defaults: ["vold_default_flags"],
72
73 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080074 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060075 ],
76 shared_libs: [
77 "libbinder",
78 "libutils",
79 ],
80 aidl: {
81 local_include_dirs: ["binder"],
82 include_dirs: ["frameworks/native/aidl/binder"],
83 export_aidl_headers: true,
84 },
85}
86
Risanaedae612017-11-27 18:01:35 +090087cc_library_headers {
88 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070089 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090090 export_include_dirs: ["."],
91}
92
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060093// Static library factored out to support testing
94cc_library_static {
95 name: "libvold",
96 defaults: [
97 "vold_default_flags",
98 "vold_default_libs",
99 ],
100
101 srcs: [
Risanac02a482018-10-31 21:59:47 -0600102 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600103 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600104 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700105 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600106 "Devmapper.cpp",
107 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600108 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700109 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600110 "IdleMaint.cpp",
111 "KeyBuffer.cpp",
112 "KeyStorage.cpp",
113 "KeyUtil.cpp",
114 "Keymaster.cpp",
115 "Loop.cpp",
116 "MetadataCrypt.cpp",
117 "MoveStorage.cpp",
118 "NetlinkHandler.cpp",
119 "NetlinkManager.cpp",
120 "Process.cpp",
121 "ScryptParameters.cpp",
122 "Utils.cpp",
123 "VoldNativeService.cpp",
124 "VoldUtil.cpp",
125 "VolumeManager.cpp",
126 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900127 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600128 "fs/Ext4.cpp",
129 "fs/F2fs.cpp",
130 "fs/Vfat.cpp",
131 "model/Disk.cpp",
132 "model/EmulatedVolume.cpp",
133 "model/ObbVolume.cpp",
134 "model/PrivateVolume.cpp",
135 "model/PublicVolume.cpp",
136 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900137 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600138 ],
Risanaedae612017-11-27 18:01:35 +0900139 product_variables: {
140 arc: {
141 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900142 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900143 "model/ObbVolume.cpp",
144 ],
145 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900146 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900147 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900148 "libarcobbvolume",
149 ],
150 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700151 debuggable: {
152 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
153 },
Risanaedae612017-11-27 18:01:35 +0900154 },
Yifan Hong024a1242018-08-10 13:50:46 -0700155 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700156 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700157 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900158 whole_static_libs: [
159 "com.android.sysprop.apex",
160 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600161}
162
163cc_binary {
164 name: "vold",
165 defaults: [
166 "vold_default_flags",
167 "vold_default_libs",
168 ],
169
170 srcs: ["main.cpp"],
171 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900172 product_variables: {
173 arc: {
174 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900175 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900176 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900177 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900178 ],
Risanaedae612017-11-27 18:01:35 +0900179 },
180 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700181 init_rc: [
182 "vold.rc",
183 "wait_for_keymaster.rc",
184 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600185
186 required: [
187 "mke2fs",
188 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800189 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600190 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700191
192 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700193 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700194 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600195}
196
197cc_binary {
198 name: "vdc",
199 defaults: ["vold_default_flags"],
200
201 srcs: ["vdc.cpp"],
202 shared_libs: [
203 "libbase",
204 "libbinder",
205 "libcutils",
206 "libutils",
207 ],
208 static_libs: [
209 "libvold_binder",
210 ],
211 init_rc: ["vdc.rc"],
212}
213
214cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800215 name: "wait_for_keymaster",
216 defaults: ["vold_default_flags"],
217
218 srcs: [
219 "wait_for_keymaster.cpp",
220 "Keymaster.cpp",
221 ],
222 shared_libs: [
223 "libbase",
224 "libbinder",
225
226 "android.hardware.keymaster@3.0",
227 "android.hardware.keymaster@4.0",
228 "libhardware",
229 "libhardware_legacy",
230 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800231 "libkeymaster4support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700232 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800233 ],
234}
235
236cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600237 name: "secdiscard",
238 defaults: ["vold_default_flags"],
239
240 srcs: [
241 "FileDeviceUtils.cpp",
242 "secdiscard.cpp",
243 ],
244 shared_libs: ["libbase"],
245}
246
247cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600248 name: "vold_prepare_subdirs",
249 defaults: ["vold_default_flags"],
250
Paul Crowley82b41ff2017-10-20 08:17:54 -0700251 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
252 shared_libs: [
253 "libbase",
254 "libcutils",
255 "liblogwrap",
256 "libselinux",
257 "libutils",
258 ],
259 static_libs: [
260 "libvold_binder",
261 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600262}
263
Colin Crossa8388632017-11-25 08:47:19 -0800264filegroup {
265 name: "vold_aidl",
266 srcs: [
267 "binder/android/os/IVold.aidl",
268 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000269 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800270 "binder/android/os/IVoldTaskListener.aidl",
271 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700272 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800273}