blob: 5d93bfae8a72ade619c6f0729299f1b70313b9d9 [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",
David Andersonb9224732019-05-13 13:02:54 -070033 "libdm",
David Anderson10de69d2019-06-27 13:40:09 -070034 "libext2_uuid",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060035 "libfec",
36 "libfec_rs",
Bowgo Tsai549fd0e2018-11-29 22:15:08 +080037 "libfs_avb",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060038 "libfs_mgr",
39 "libscrypt_static",
40 "libsquashfs_utils",
41 "libvold_binder",
42 ],
43 shared_libs: [
44 "android.hardware.keymaster@3.0",
Shawn Willden35351812018-01-22 09:08:32 -070045 "android.hardware.keymaster@4.0",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070046 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060047 "libbase",
48 "libbinder",
49 "libcrypto",
50 "libcrypto_utils",
51 "libcutils",
52 "libdiskconfig",
53 "libext4_utils",
54 "libf2fs_sparseblock",
55 "libhardware",
56 "libhardware_legacy",
57 "libhidlbase",
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",
Tao Baob1bbc702019-10-01 23:31:17 -070088 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090089 export_include_dirs: ["."],
90}
91
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060092// Static library factored out to support testing
93cc_library_static {
94 name: "libvold",
95 defaults: [
96 "vold_default_flags",
97 "vold_default_libs",
98 ],
99
100 srcs: [
Risanac02a482018-10-31 21:59:47 -0600101 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102 "Benchmark.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600103 "CheckEncryption.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700104 "Checkpoint.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600105 "Devmapper.cpp",
106 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600107 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700108 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600109 "IdleMaint.cpp",
110 "KeyBuffer.cpp",
111 "KeyStorage.cpp",
112 "KeyUtil.cpp",
113 "Keymaster.cpp",
114 "Loop.cpp",
115 "MetadataCrypt.cpp",
116 "MoveStorage.cpp",
117 "NetlinkHandler.cpp",
118 "NetlinkManager.cpp",
119 "Process.cpp",
120 "ScryptParameters.cpp",
121 "Utils.cpp",
122 "VoldNativeService.cpp",
123 "VoldUtil.cpp",
124 "VolumeManager.cpp",
125 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900126 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600127 "fs/Ext4.cpp",
128 "fs/F2fs.cpp",
129 "fs/Vfat.cpp",
130 "model/Disk.cpp",
131 "model/EmulatedVolume.cpp",
132 "model/ObbVolume.cpp",
133 "model/PrivateVolume.cpp",
134 "model/PublicVolume.cpp",
135 "model/VolumeBase.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900136 "model/StubVolume.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600137 ],
Risanaedae612017-11-27 18:01:35 +0900138 product_variables: {
139 arc: {
140 exclude_srcs: [
Risandcbd4fc2018-11-02 01:26:31 +0900141 "AppFuseUtil.cpp",
Risanaedae612017-11-27 18:01:35 +0900142 "model/ObbVolume.cpp",
143 ],
144 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900145 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900146 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900147 "libarcobbvolume",
148 ],
149 },
Mark Salyzync4405e92018-09-20 10:09:27 -0700150 debuggable: {
151 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
152 },
Risanaedae612017-11-27 18:01:35 +0900153 },
Yifan Hong024a1242018-08-10 13:50:46 -0700154 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700155 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700156 ],
Jiyong Park8d21c922019-01-04 13:35:25 +0900157 whole_static_libs: [
158 "com.android.sysprop.apex",
159 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600160}
161
162cc_binary {
163 name: "vold",
164 defaults: [
165 "vold_default_flags",
166 "vold_default_libs",
167 ],
168
169 srcs: ["main.cpp"],
170 static_libs: ["libvold"],
Risanaedae612017-11-27 18:01:35 +0900171 product_variables: {
172 arc: {
173 static_libs: [
Risanea2d2bb2018-02-23 08:12:37 +0900174 "arc_services_aidl",
Risandcbd4fc2018-11-02 01:26:31 +0900175 "libarcappfuse",
Risanaedae612017-11-27 18:01:35 +0900176 "libarcobbvolume",
Risan9929e7d2018-01-22 11:04:25 +0900177 ],
Risanaedae612017-11-27 18:01:35 +0900178 },
179 },
Wei Wangf5b085c2018-05-15 16:12:20 -0700180 init_rc: [
181 "vold.rc",
182 "wait_for_keymaster.rc",
183 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600184
185 required: [
186 "mke2fs",
187 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800188 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600189 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700190
191 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700192 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700193 ],
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",
Paul Crowley8f828792018-02-07 14:41:26 -0800230 "libkeymaster4support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700231 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800232 ],
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",
Zim5048b4b2019-11-19 09:16:03 +0000268 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800269 "binder/android/os/IVoldTaskListener.aidl",
270 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700271 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800272}