blob: 4852fe418ce0a342de7c4f5e5160989e347f6662 [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",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070047 "android.hardware.keymaster@4.1",
Daniel Rosenbergd3992492018-10-02 17:40:44 -070048 "android.hardware.boot@1.0",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060049 "libbase",
50 "libbinder",
51 "libcrypto",
52 "libcrypto_utils",
53 "libcutils",
54 "libdiskconfig",
55 "libext4_utils",
56 "libf2fs_sparseblock",
57 "libhardware",
58 "libhardware_legacy",
Songchun Fanab55cec2019-12-02 10:50:12 -080059 "libincfs",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060060 "libhidlbase",
Shawn Willden35351812018-01-22 09:08:32 -070061 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -070062 "libkeymaster4_1support",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060063 "libkeyutils",
64 "liblog",
65 "liblogwrap",
66 "libselinux",
67 "libsysutils",
68 "libutils",
69 ],
70}
71
72cc_library_static {
73 name: "libvold_binder",
74 defaults: ["vold_default_flags"],
75
76 srcs: [
Colin Crossa8388632017-11-25 08:47:19 -080077 ":vold_aidl",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060078 ],
79 shared_libs: [
80 "libbinder",
81 "libutils",
82 ],
83 aidl: {
84 local_include_dirs: ["binder"],
Songchun Fanab55cec2019-12-02 10:50:12 -080085 include_dirs: [
86 "frameworks/native/aidl/binder",
Jiyong Park50c3ab62020-01-20 12:37:52 +090087 "frameworks/base/core/java",
Songchun Fanab55cec2019-12-02 10:50:12 -080088 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060089 export_aidl_headers: true,
90 },
Songchun Fanab55cec2019-12-02 10:50:12 -080091 whole_static_libs: [
Jeongik Cha44b2f952020-08-14 23:51:36 +090092 "libincremental_aidl-unstable-cpp",
Songchun Fanab55cec2019-12-02 10:50:12 -080093 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -060094}
95
Risanaedae612017-11-27 18:01:35 +090096cc_library_headers {
97 name: "libvold_headers",
Tao Baob1bbc702019-10-01 23:31:17 -070098 recovery_available: true,
Risanaedae612017-11-27 18:01:35 +090099 export_include_dirs: ["."],
100}
101
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600102// Static library factored out to support testing
103cc_library_static {
104 name: "libvold",
105 defaults: [
106 "vold_default_flags",
107 "vold_default_libs",
108 ],
109
110 srcs: [
Risanac02a482018-10-31 21:59:47 -0600111 "AppFuseUtil.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600112 "Benchmark.cpp",
Daniel Rosenberg65f99c92018-08-28 01:58:49 -0700113 "Checkpoint.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800114 "CryptoType.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600115 "Devmapper.cpp",
116 "EncryptInplace.cpp",
Jeff Sharkey2048a282017-06-15 09:59:43 -0600117 "FileDeviceUtils.cpp",
Eric Biggersa701c452018-10-23 13:06:55 -0700118 "FsCrypt.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600119 "IdleMaint.cpp",
120 "KeyBuffer.cpp",
121 "KeyStorage.cpp",
122 "KeyUtil.cpp",
123 "Keymaster.cpp",
124 "Loop.cpp",
125 "MetadataCrypt.cpp",
126 "MoveStorage.cpp",
127 "NetlinkHandler.cpp",
128 "NetlinkManager.cpp",
129 "Process.cpp",
130 "ScryptParameters.cpp",
131 "Utils.cpp",
132 "VoldNativeService.cpp",
Yurii Zubrytskyi131365a2020-03-24 23:49:02 -0700133 "VoldNativeServiceValidation.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600134 "VoldUtil.cpp",
135 "VolumeManager.cpp",
136 "cryptfs.cpp",
Jeff Sharkey37ba1252018-01-19 10:55:18 +0900137 "fs/Exfat.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600138 "fs/Ext4.cpp",
139 "fs/F2fs.cpp",
140 "fs/Vfat.cpp",
141 "model/Disk.cpp",
142 "model/EmulatedVolume.cpp",
143 "model/ObbVolume.cpp",
144 "model/PrivateVolume.cpp",
145 "model/PublicVolume.cpp",
Risan8c9f3322018-10-29 08:52:56 +0900146 "model/StubVolume.cpp",
Paul Crowley220567c2020-02-07 12:45:20 -0800147 "model/VolumeBase.cpp",
Paul Crowley886e5722020-02-07 12:51:56 -0800148 "model/VolumeEncryption.cpp",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600149 ],
Mark Salyzyn865086d2020-07-17 08:17:50 -0700150 product_variables: {
151 debuggable: {
152 cppflags: ["-D__ANDROID_DEBUGGABLE__"],
153 },
154 },
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",
Martijn Coenen816f4d92020-02-18 15:06:37 +0100160 "libc++fs"
Jiyong Park8d21c922019-01-04 13:35:25 +0900161 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600162}
163
164cc_binary {
165 name: "vold",
166 defaults: [
167 "vold_default_flags",
168 "vold_default_libs",
169 ],
170
171 srcs: ["main.cpp"],
172 static_libs: ["libvold"],
Wei Wangf5b085c2018-05-15 16:12:20 -0700173 init_rc: [
174 "vold.rc",
175 "wait_for_keymaster.rc",
176 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600177
178 required: [
179 "mke2fs",
180 "vold_prepare_subdirs",
Paul Crowley8f828792018-02-07 14:41:26 -0800181 "wait_for_keymaster",
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600182 ],
Yifan Hong024a1242018-08-10 13:50:46 -0700183
184 shared_libs: [
Yifan Hong91a68df2018-09-19 10:28:16 -0700185 "android.hardware.health.storage@1.0",
Yifan Hong024a1242018-08-10 13:50:46 -0700186 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600187}
188
189cc_binary {
190 name: "vdc",
191 defaults: ["vold_default_flags"],
192
193 srcs: ["vdc.cpp"],
194 shared_libs: [
195 "libbase",
196 "libbinder",
197 "libcutils",
198 "libutils",
199 ],
200 static_libs: [
201 "libvold_binder",
202 ],
203 init_rc: ["vdc.rc"],
204}
205
206cc_binary {
Paul Crowley8f828792018-02-07 14:41:26 -0800207 name: "wait_for_keymaster",
208 defaults: ["vold_default_flags"],
209
210 srcs: [
211 "wait_for_keymaster.cpp",
212 "Keymaster.cpp",
213 ],
214 shared_libs: [
215 "libbase",
216 "libbinder",
217
218 "android.hardware.keymaster@3.0",
219 "android.hardware.keymaster@4.0",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700220 "android.hardware.keymaster@4.1",
Paul Crowley8f828792018-02-07 14:41:26 -0800221 "libhardware",
222 "libhardware_legacy",
223 "libhidlbase",
Paul Crowley8f828792018-02-07 14:41:26 -0800224 "libkeymaster4support",
Shawn Willdenae8f06f2020-01-16 13:21:42 -0700225 "libkeymaster4_1support",
Janis Danisevskis1e782f02019-06-12 13:27:20 -0700226 "libutils",
Paul Crowley8f828792018-02-07 14:41:26 -0800227 ],
228}
229
230cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600231 name: "secdiscard",
232 defaults: ["vold_default_flags"],
233
234 srcs: [
235 "FileDeviceUtils.cpp",
236 "secdiscard.cpp",
237 ],
238 shared_libs: ["libbase"],
239}
240
241cc_binary {
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600242 name: "vold_prepare_subdirs",
243 defaults: ["vold_default_flags"],
244
Paul Crowley82b41ff2017-10-20 08:17:54 -0700245 srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"],
246 shared_libs: [
247 "libbase",
248 "libcutils",
249 "liblogwrap",
250 "libselinux",
251 "libutils",
252 ],
253 static_libs: [
254 "libvold_binder",
255 ],
Jeff Sharkeyd16dc502017-10-23 14:38:55 -0600256}
257
Colin Crossa8388632017-11-25 08:47:19 -0800258filegroup {
259 name: "vold_aidl",
260 srcs: [
261 "binder/android/os/IVold.aidl",
262 "binder/android/os/IVoldListener.aidl",
Zim5048b4b2019-11-19 09:16:03 +0000263 "binder/android/os/IVoldMountCallback.aidl",
Colin Crossa8388632017-11-25 08:47:19 -0800264 "binder/android/os/IVoldTaskListener.aidl",
265 ],
Dan Willemsen87c7f882018-09-14 21:28:50 -0700266 path: "binder",
Colin Crossa8388632017-11-25 08:47:19 -0800267}