blob: af77cef34cd0d1883b2519584da2019d8508a22f [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",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070042 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060043 "libbase",
44 "libbinder",
45 "libcrypto",
46 "libcrypto_utils",
47 "libcutils",
48 "libdiskconfig",
49 "libext4_utils",
50 "libf2fs_sparseblock",
51 "libhardware",
52 "libhardware_legacy",
53 "libhidlbase",
54 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070055 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060056 "libkeyutils",
57 "liblog",
58 "liblogwrap",
59 "libselinux",
60 "libsysutils",
61 "libutils",
62 ],
63}
64
65cc_library_static {
66 name: "libvold_binder",
67 defaults: ["vold_default_flags"],
68
69 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080070 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060071 ],
72 shared_libs: [
73 "libbinder",
74 "libutils",
75 ],
76 aidl: {
77 local_include_dirs: ["binder"],
78 include_dirs: ["frameworks/native/aidl/binder"],
79 export_aidl_headers: true,
80 },
81}
82
Risanaedae612017-11-27 18:01:35 +090083cc_library_headers {
84 name: "libvold_headers",
85 export_include_dirs: ["."],
86}
87
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060088// Static library factored out to support testing
89cc_library_static {
90 name: "libvold",
91 defaults: [
92 "vold_default_flags",
93 "vold_default_libs",
94 ],
95
96 srcs: [
97 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -060098 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -070099 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600100 "Devmapper.cpp",
101 "EncryptInplace.cpp",
102 "Ext4Crypt.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600103 "FileDeviceUtils.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600104 "IdleMaint.cpp",
105 "KeyBuffer.cpp",
106 "KeyStorage.cpp",
107 "KeyUtil.cpp",
108 "Keymaster.cpp",
109 "Loop.cpp",
110 "MetadataCrypt.cpp",
111 "MoveStorage.cpp",
112 "NetlinkHandler.cpp",
113 "NetlinkManager.cpp",
114 "Process.cpp",
115 "ScryptParameters.cpp",
116 "Utils.cpp",
117 "VoldNativeService.cpp",
118 "VoldUtil.cpp",
119 "VolumeManager.cpp",
120 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900121 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600122 "fs/Ext4.cpp",
123 "fs/F2fs.cpp",
124 "fs/Vfat.cpp",
125 "model/Disk.cpp",
126 "model/EmulatedVolume.cpp",
127 "model/ObbVolume.cpp",
128 "model/PrivateVolume.cpp",
129 "model/PublicVolume.cpp",
130 "model/VolumeBase.cpp",
131 "secontext.cpp",
132 ],
Risanaedae612017-11-27 18:01:35 +0900133 product_variables: {
134 arc: {
135 exclude_srcs: [
136 "model/ObbVolume.cpp",
137 ],
138 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900139 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900140 "libarcobbvolume",
141 ],
142 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700143 debuggable: {
144 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
145 },
Risanaedae612017-11-27 18:01:35 +0900146 },
Yifan Hong024a1242018-08-10 13:50:46 -0700147 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700148 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700149 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600150}
151
152cc_binary {
153 name: "vold",
154 defaults: [
155 "vold_default_flags",
156 "vold_default_libs",
157 ],
158
159 srcs: ["main.cpp"],
160 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900161 product_variables: {
162 arc: {
163 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900164 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900165 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900166 ],
Risanaedae612017-11-27 18:01:35 +0900167 },
168 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700169 init_rc: [
170 "vold.rc",
171 "wait_for_keymaster.rc",
172 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600173
174 required: [
175 "mke2fs",
176 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800177 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600178 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700179
180 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700181 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700182 "libhidltransport",
183 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600184}
185
186cc_binary {
187 name: "vdc",
188 defaults: ["vold_default_flags"],
189
190 srcs: ["vdc.cpp"],
191 shared_libs: [
192 "libbase",
193 "libbinder",
194 "libcutils",
195 "libutils",
196 ],
197 static_libs: [
198 "libvold_binder",
199 ],
200 init_rc: ["vdc.rc"],
201}
202
203cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800204 name: "wait_for_keymaster",
205 defaults: ["vold_default_flags"],
206
207 srcs: [
208 "wait_for_keymaster.cpp",
209 "Keymaster.cpp",
210 ],
211 shared_libs: [
212 "libbase",
213 "libbinder",
214
215 "android.hardware.keymaster@3.0",
216 "android.hardware.keymaster@4.0",
217 "libhardware",
218 "libhardware_legacy",
219 "libhidlbase",
220 "libhwbinder",
221 "libkeymaster4support",
222 ],
223}
224
225cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600226 name: "secdiscard",
227 defaults: ["vold_default_flags"],
228
229 srcs: [
230 "FileDeviceUtils.cpp",
231 "secdiscard.cpp",
232 ],
233 shared_libs: ["libbase"],
234}
235
236cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600237 name: "vold_prepare_subdirs",
238 defaults: ["vold_default_flags"],
239
Paul Crowley82b41ff2017-10-20 08:17:54 -0700240 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
241 shared_libs: [
242 "libbase",
243 "libcutils",
244 "liblogwrap",
245 "libselinux",
246 "libutils",
247 ],
248 static_libs: [
249 "libvold_binder",
250 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600251}
252
Colin Crossa8388632017-11-25 08:47:19 -0800253filegroup {
254 name: "vold_aidl",
255 srcs: [
256 "binder/android/os/IVold.aidl",
257 "binder/android/os/IVoldListener.aidl",
258 "binder/android/os/IVoldTaskListener.aidl",
259 ],
260}
261
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600262subdirs = ["tests"]