blob: ac4eb596ac2524297b73c25e293ff8482968e2e4 [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: [
Risanac02a482018-10-31 21:59:47 -060099 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600100 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600101 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700102 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600103 "Devmapper.cpp",
104 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600105 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700106 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600107 "IdleMaint.cpp",
108 "KeyBuffer.cpp",
109 "KeyStorage.cpp",
110 "KeyUtil.cpp",
111 "Keymaster.cpp",
112 "Loop.cpp",
113 "MetadataCrypt.cpp",
114 "MoveStorage.cpp",
115 "NetlinkHandler.cpp",
116 "NetlinkManager.cpp",
117 "Process.cpp",
118 "ScryptParameters.cpp",
119 "Utils.cpp",
120 "VoldNativeService.cpp",
121 "VoldUtil.cpp",
122 "VolumeManager.cpp",
123 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900124 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600125 "fs/Ext4.cpp",
126 "fs/F2fs.cpp",
127 "fs/Vfat.cpp",
128 "model/Disk.cpp",
129 "model/EmulatedVolume.cpp",
130 "model/ObbVolume.cpp",
131 "model/PrivateVolume.cpp",
132 "model/PublicVolume.cpp",
133 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900134 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600135 ],
Risanaedae612017-11-27 18:01:35 +0900136 product_variables: {
137 arc: {
138 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900139 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900140 "model/ObbVolume.cpp",
141 ],
142 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900143 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900144 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900145 "libarcobbvolume",
146 ],
147 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700148 debuggable: {
149 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
150 },
Risanaedae612017-11-27 18:01:35 +0900151 },
Yifan Hong024a1242018-08-10 13:50:46 -0700152 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700153 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700154 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600155}
156
157cc_binary {
158 name: "vold",
159 defaults: [
160 "vold_default_flags",
161 "vold_default_libs",
162 ],
163
164 srcs: ["main.cpp"],
165 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900166 product_variables: {
167 arc: {
168 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900169 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900170 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900171 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900172 ],
Risanaedae612017-11-27 18:01:35 +0900173 },
174 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700175 init_rc: [
176 "vold.rc",
177 "wait_for_keymaster.rc",
178 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600179
180 required: [
181 "mke2fs",
182 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800183 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600184 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700185
186 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700187 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700188 "libhidltransport",
189 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600190}
191
192cc_binary {
193 name: "vdc",
194 defaults: ["vold_default_flags"],
195
196 srcs: ["vdc.cpp"],
197 shared_libs: [
198 "libbase",
199 "libbinder",
200 "libcutils",
201 "libutils",
202 ],
203 static_libs: [
204 "libvold_binder",
205 ],
206 init_rc: ["vdc.rc"],
207}
208
209cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800210 name: "wait_for_keymaster",
211 defaults: ["vold_default_flags"],
212
213 srcs: [
214 "wait_for_keymaster.cpp",
215 "Keymaster.cpp",
216 ],
217 shared_libs: [
218 "libbase",
219 "libbinder",
220
221 "android.hardware.keymaster@3.0",
222 "android.hardware.keymaster@4.0",
223 "libhardware",
224 "libhardware_legacy",
225 "libhidlbase",
226 "libhwbinder",
227 "libkeymaster4support",
228 ],
229}
230
231cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600232 name: "secdiscard",
233 defaults: ["vold_default_flags"],
234
235 srcs: [
236 "FileDeviceUtils.cpp",
237 "secdiscard.cpp",
238 ],
239 shared_libs: ["libbase"],
240}
241
242cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600243 name: "vold_prepare_subdirs",
244 defaults: ["vold_default_flags"],
245
Paul Crowley82b41ff2017-10-20 08:17:54 -0700246 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
247 shared_libs: [
248 "libbase",
249 "libcutils",
250 "liblogwrap",
251 "libselinux",
252 "libutils",
253 ],
254 static_libs: [
255 "libvold_binder",
256 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600257}
258
Colin Crossa8388632017-11-25 08:47:19 -0800259filegroup {
260 name: "vold_aidl",
261 srcs: [
262 "binder/android/os/IVold.aidl",
263 "binder/android/os/IVoldListener.aidl",
264 "binder/android/os/IVoldTaskListener.aidl",
265 ],
266}
267
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600268subdirs = ["tests"]