blob: a8934fcf1d0e641dae3053255047aec67474d0b9 [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",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060042 "libbase",
43 "libbinder",
44 "libcrypto",
45 "libcrypto_utils",
46 "libcutils",
47 "libdiskconfig",
48 "libext4_utils",
49 "libf2fs_sparseblock",
50 "libhardware",
51 "libhardware_legacy",
52 "libhidlbase",
53 "libhwbinder",
Shawn Willden35351812018-01-22 09:08:32 -070054 "libkeymaster4support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060055 "libkeyutils",
56 "liblog",
57 "liblogwrap",
58 "libselinux",
59 "libsysutils",
60 "libutils",
61 ],
62}
63
64cc_library_static {
65 name: "libvold_binder",
66 defaults: ["vold_default_flags"],
67
68 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080069 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060070 ],
71 shared_libs: [
72 "libbinder",
73 "libutils",
74 ],
75 aidl: {
76 local_include_dirs: ["binder"],
77 include_dirs: ["frameworks/native/aidl/binder"],
78 export_aidl_headers: true,
79 },
80}
81
Risanaedae612017-11-27 18:01:35 +090082cc_library_headers {
83 name: "libvold_headers",
84 export_include_dirs: ["."],
85}
86
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060087// Static library factored out to support testing
88cc_library_static {
89 name: "libvold",
90 defaults: [
91 "vold_default_flags",
92 "vold_default_libs",
93 ],
94
95 srcs: [
96 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -060097 "CheckEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060098 "Devmapper.cpp",
99 "EncryptInplace.cpp",
100 "Ext4Crypt.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600101 "FileDeviceUtils.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102 "IdleMaint.cpp",
103 "KeyBuffer.cpp",
104 "KeyStorage.cpp",
105 "KeyUtil.cpp",
106 "Keymaster.cpp",
107 "Loop.cpp",
108 "MetadataCrypt.cpp",
109 "MoveStorage.cpp",
110 "NetlinkHandler.cpp",
111 "NetlinkManager.cpp",
112 "Process.cpp",
113 "ScryptParameters.cpp",
114 "Utils.cpp",
115 "VoldNativeService.cpp",
116 "VoldUtil.cpp",
117 "VolumeManager.cpp",
118 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900119 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600120 "fs/Ext4.cpp",
121 "fs/F2fs.cpp",
122 "fs/Vfat.cpp",
123 "model/Disk.cpp",
124 "model/EmulatedVolume.cpp",
125 "model/ObbVolume.cpp",
126 "model/PrivateVolume.cpp",
127 "model/PublicVolume.cpp",
128 "model/VolumeBase.cpp",
129 "secontext.cpp",
130 ],
Risanaedae612017-11-27 18:01:35 +0900131 product_variables: {
132 arc: {
133 exclude_srcs: [
134 "model/ObbVolume.cpp",
135 ],
136 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900137 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900138 "libarcobbvolume",
139 ],
140 },
141 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600142}
143
144cc_binary {
145 name: "vold",
146 defaults: [
147 "vold_default_flags",
148 "vold_default_libs",
149 ],
150
151 srcs: ["main.cpp"],
152 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900153 product_variables: {
154 arc: {
155 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900156 "arc_services_aidl",
Risanaedae612017-11-27 18:01:35 +0900157 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900158 ],
Risanaedae612017-11-27 18:01:35 +0900159 },
160 },
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600161 init_rc: ["vold.rc"],
162
163 required: [
164 "mke2fs",
165 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800166 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600167 ],
168}
169
170cc_binary {
171 name: "vdc",
172 defaults: ["vold_default_flags"],
173
174 srcs: ["vdc.cpp"],
175 shared_libs: [
176 "libbase",
177 "libbinder",
178 "libcutils",
179 "libutils",
180 ],
181 static_libs: [
182 "libvold_binder",
183 ],
184 init_rc: ["vdc.rc"],
185}
186
187cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800188 name: "wait_for_keymaster",
189 defaults: ["vold_default_flags"],
190
191 srcs: [
192 "wait_for_keymaster.cpp",
193 "Keymaster.cpp",
194 ],
195 shared_libs: [
196 "libbase",
197 "libbinder",
198
199 "android.hardware.keymaster@3.0",
200 "android.hardware.keymaster@4.0",
201 "libhardware",
202 "libhardware_legacy",
203 "libhidlbase",
204 "libhwbinder",
205 "libkeymaster4support",
206 ],
207}
208
209cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600210 name: "secdiscard",
211 defaults: ["vold_default_flags"],
212
213 srcs: [
214 "FileDeviceUtils.cpp",
215 "secdiscard.cpp",
216 ],
217 shared_libs: ["libbase"],
218}
219
220cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600221 name: "vold_prepare_subdirs",
222 defaults: ["vold_default_flags"],
223
Paul Crowley82b41ff2017-10-20 08:17:54 -0700224 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
225 shared_libs: [
226 "libbase",
227 "libcutils",
228 "liblogwrap",
229 "libselinux",
230 "libutils",
231 ],
232 static_libs: [
233 "libvold_binder",
234 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600235}
236
Colin Crossa8388632017-11-25 08:47:19 -0800237filegroup {
238 name: "vold_aidl",
239 srcs: [
240 "binder/android/os/IVold.aidl",
241 "binder/android/os/IVoldListener.aidl",
242 "binder/android/os/IVoldTaskListener.aidl",
243 ],
244}
245
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600246subdirs = ["tests"]