• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5cc_defaults {
6    name: "vold_default_flags",
7
8    cflags: [
9        "-Wall",
10        "-Werror",
11        "-Wextra",
12        "-Wno-unused-parameter",
13    ],
14
15    tidy: true,
16    tidy_checks: [
17        "-*",
18        "cert-*",
19        "clang-analyzer-security*",
20        "android-*",
21    ],
22    tidy_checks_as_errors: [
23        "clang-analyzer-security*",
24        "cert-*",
25    ],
26}
27
28cc_defaults {
29    name: "vold_default_libs",
30
31    static_libs: [
32        "libasync_safe",
33        "libavb",
34        "libbootloader_message",
35        "libdm",
36        "libext2_uuid",
37        "libfec",
38        "libfec_rs",
39        "libfs_avb",
40        "libfs_mgr",
41        "libsquashfs_utils",
42        "libvold_binder",
43    ],
44    shared_libs: [
45        "android.hardware.boot@1.0",
46        "android.hardware.boot-V1-ndk",
47        "libboot_control_client",
48        "libbase",
49        "libbinder",
50        "libcrypto",
51        "libcrypto_utils",
52        "libcutils",
53        "libdiskconfig",
54        "libext4_utils",
55        "libf2fs_sparseblock",
56        "libgsi",
57        "libhardware",
58        "libhardware_legacy",
59        "libincfs",
60        "libhidlbase",
61        "libkeyutils",
62        "liblog",
63        "liblogwrap",
64        "libselinux",
65        "libsysutils",
66        "libutils",
67    ],
68}
69
70cc_library_static {
71    name: "libvold_binder",
72    defaults: ["vold_default_flags"],
73
74    srcs: [
75        ":vold_aidl",
76    ],
77    shared_libs: [
78        "libbinder",
79        "libutils",
80    ],
81    aidl: {
82        local_include_dirs: ["binder"],
83        include_dirs: [
84            "frameworks/native/aidl/binder",
85            "frameworks/base/core/java",
86        ],
87        export_aidl_headers: true,
88    },
89    whole_static_libs: [
90        "libincremental_aidl-cpp",
91    ],
92    export_shared_lib_headers: [
93        "libbinder",
94    ],
95}
96
97cc_library_headers {
98    name: "libvold_headers",
99    recovery_available: true,
100    export_include_dirs: ["."],
101}
102
103// Static library factored out to support testing
104cc_library_static {
105    name: "libvold",
106    defaults: [
107        "vold_default_flags",
108        "vold_default_libs",
109        "keystore2_use_latest_aidl_ndk_shared",
110    ],
111
112    srcs: [
113        "AppFuseUtil.cpp",
114        "Benchmark.cpp",
115        "Checkpoint.cpp",
116        "CryptoType.cpp",
117        "EncryptInplace.cpp",
118        "FileDeviceUtils.cpp",
119        "FsCrypt.cpp",
120        "IdleMaint.cpp",
121        "KeyBuffer.cpp",
122        "KeyStorage.cpp",
123        "KeyUtil.cpp",
124        "Keystore.cpp",
125        "Loop.cpp",
126        "MetadataCrypt.cpp",
127        "MoveStorage.cpp",
128        "NetlinkHandler.cpp",
129        "NetlinkManager.cpp",
130        "Process.cpp",
131        "Utils.cpp",
132        "VoldNativeService.cpp",
133        "VoldNativeServiceValidation.cpp",
134        "VoldUtil.cpp",
135        "VolumeManager.cpp",
136        "cryptfs.cpp",
137        "fs/Exfat.cpp",
138        "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",
146        "model/StubVolume.cpp",
147        "model/VolumeBase.cpp",
148        "model/VolumeEncryption.cpp",
149    ],
150    product_variables: {
151        arc: {
152            exclude_srcs: [
153                "model/StubVolume.cpp",
154            ],
155            static_libs: [
156                "libarcvolume",
157            ],
158        },
159        debuggable: {
160            cppflags: ["-D__ANDROID_DEBUGGABLE__"],
161        },
162    },
163    shared_libs: [
164        "android.hardware.health.storage@1.0",
165        "android.hardware.health.storage-V1-ndk",
166        "android.security.maintenance-ndk",
167        "libbinder_ndk",
168        "libkeymint_support",
169    ],
170    whole_static_libs: [
171        "libcom.android.sysprop.apex",
172        "libc++fs",
173    ],
174}
175
176cc_binary {
177    name: "vold",
178    defaults: [
179        "vold_default_flags",
180        "vold_default_libs",
181        "keystore2_use_latest_aidl_ndk_shared",
182    ],
183
184    srcs: ["main.cpp"],
185    static_libs: ["libvold"],
186    init_rc: [
187        "vold.rc",
188    ],
189
190    required: [
191        "mke2fs",
192        "vold_prepare_subdirs",
193        "fuseMedia.o",
194    ],
195
196    shared_libs: [
197        "android.hardware.health.storage@1.0",
198        "android.hardware.health.storage-V1-ndk",
199        "android.security.maintenance-ndk",
200        "libbinder_ndk",
201        "libkeymint_support",
202    ],
203
204    product_variables: {
205        arc: {
206            exclude_srcs: [
207                "model/StubVolume.cpp",
208            ],
209            static_libs: [
210                "libarcvolume",
211            ],
212        },
213    },
214}
215
216cc_binary {
217    name: "vdc",
218    defaults: ["vold_default_flags"],
219
220    srcs: [
221        "vdc.cpp",
222        "Utils.cpp",
223    ],
224    shared_libs: [
225        "libbase",
226        "libbinder",
227        "libcutils",
228        "liblogwrap",
229        "libselinux",
230        "libutils",
231    ],
232    static_libs: [
233        "libvold_binder",
234    ],
235}
236
237cc_binary {
238    name: "secdiscard",
239    defaults: ["vold_default_flags"],
240
241    srcs: [
242        "FileDeviceUtils.cpp",
243        "secdiscard.cpp",
244    ],
245    shared_libs: ["libbase"],
246}
247
248cc_binary {
249    name: "vold_prepare_subdirs",
250    defaults: ["vold_default_flags"],
251
252    srcs: [
253        "vold_prepare_subdirs.cpp",
254        "Utils.cpp",
255    ],
256    shared_libs: [
257        "libbase",
258        "libcutils",
259        "liblogwrap",
260        "libselinux",
261        "libutils",
262    ],
263    static_libs: [
264        "libvold_binder",
265    ],
266}
267
268filegroup {
269    name: "vold_aidl",
270    srcs: [
271        "binder/android/os/IVold.aidl",
272        "binder/android/os/IVoldListener.aidl",
273        "binder/android/os/IVoldMountCallback.aidl",
274        "binder/android/os/IVoldTaskListener.aidl",
275    ],
276    path: "binder",
277}
278