• 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        "android.hardware.health.storage@1.0",
33        "android.hardware.health.storage-V1-ndk",
34        "android.security.maintenance-ndk",
35        "libasync_safe",
36        "libavb",
37        "libbootloader_message",
38        "libdm",
39        "libext2_uuid",
40        "libfec",
41        "libfec_rs",
42        "libfs_avb",
43        "libfs_mgr",
44        "libsquashfs_utils",
45        "libvold_binder",
46        "android.system.vold-V1-cpp",
47    ],
48    shared_libs: [
49        "android.hardware.boot@1.0",
50        "android.hardware.boot-V1-ndk",
51        "libboot_control_client",
52        "libbase",
53        "libbinder",
54        "libbinder_ndk",
55        "libcrypto",
56        "libcrypto_utils",
57        "libcutils",
58        "libext4_utils",
59        "libf2fs_sparseblock",
60        "libgsi",
61        "libhardware",
62        "libhardware_legacy",
63        "libincfs",
64        "libhidlbase",
65        "libkeymint_support",
66        "liblog",
67        "liblogwrap",
68        "libselinux",
69        "libsysutils",
70        "libutils",
71    ],
72}
73
74cc_library_static {
75    name: "libvold_binder",
76    defaults: ["vold_default_flags"],
77
78    srcs: [
79        ":vold_aidl",
80    ],
81    shared_libs: [
82        "libbinder",
83        "libutils",
84    ],
85    aidl: {
86        local_include_dirs: ["binder"],
87        include_dirs: [
88            "frameworks/native/aidl/binder",
89            "frameworks/base/core/java",
90        ],
91        export_aidl_headers: true,
92    },
93    whole_static_libs: [
94        "libincremental_aidl-cpp",
95    ],
96    export_shared_lib_headers: [
97        "libbinder",
98    ],
99}
100
101cc_library_headers {
102    name: "libvold_headers",
103    recovery_available: true,
104    export_include_dirs: ["."],
105}
106
107vintf_fragment {
108    name: "android.system.vold-service.xml",
109    src: "android.system.vold-service.xml",
110}
111
112// Static library factored out to support testing
113cc_library_static {
114    name: "libvold",
115    defaults: [
116        "vold_default_flags",
117        "vold_default_libs",
118        "keystore2_use_latest_aidl_ndk_shared",
119    ],
120
121    srcs: [
122        "AppFuseUtil.cpp",
123        "Benchmark.cpp",
124        "Checkpoint.cpp",
125        "CryptoType.cpp",
126        "EncryptInplace.cpp",
127        "FileDeviceUtils.cpp",
128        "FsCrypt.cpp",
129        "IdleMaint.cpp",
130        "KeyBuffer.cpp",
131        "KeyStorage.cpp",
132        "KeyUtil.cpp",
133        "Keystore.cpp",
134        "Loop.cpp",
135        "MetadataCrypt.cpp",
136        "MoveStorage.cpp",
137        "NetlinkHandler.cpp",
138        "NetlinkManager.cpp",
139        "Process.cpp",
140        "Utils.cpp",
141        "VendorVoldNativeService.cpp",
142        "VoldNativeService.cpp",
143        "VoldNativeServiceValidation.cpp",
144        "VoldUtil.cpp",
145        "VolumeManager.cpp",
146        "WriteBooster.cpp",
147        "cryptfs.cpp",
148        "fs/Exfat.cpp",
149        "fs/Ext4.cpp",
150        "fs/F2fs.cpp",
151        "fs/Vfat.cpp",
152        "model/Disk.cpp",
153        "model/EmulatedVolume.cpp",
154        "model/ObbVolume.cpp",
155        "model/PrivateVolume.cpp",
156        "model/PublicVolume.cpp",
157        "model/StubVolume.cpp",
158        "model/VolumeBase.cpp",
159        "model/VolumeEncryption.cpp",
160    ],
161    shared_libs: [
162        "server_configurable_flags",
163    ],
164    static_libs: [
165        "vold_flags_c_lib",
166    ],
167    product_variables: {
168        arc: {
169            exclude_srcs: [
170                "model/StubVolume.cpp",
171            ],
172            static_libs: [
173                "libarcvolume",
174            ],
175        },
176        debuggable: {
177            cppflags: ["-D__ANDROID_DEBUGGABLE__"],
178        },
179    },
180}
181
182cc_binary {
183    name: "vold",
184    defaults: [
185        "vold_default_flags",
186        "vold_default_libs",
187        "keystore2_use_latest_aidl_ndk_shared",
188    ],
189
190    srcs: ["main.cpp"],
191    static_libs: [
192        "libvold",
193    ],
194
195    init_rc: [
196        "vold.rc",
197    ],
198
199    required: [
200        "mke2fs",
201        "vold_prepare_subdirs",
202        "fuseMedia.o",
203    ],
204
205    product_variables: {
206        arc: {
207            exclude_srcs: [
208                "model/StubVolume.cpp",
209            ],
210            static_libs: [
211                "libarcvolume",
212            ],
213        },
214    },
215    vintf_fragment_modules: ["android.system.vold-service.xml"],
216}
217
218cc_binary {
219    name: "vdc",
220    defaults: ["vold_default_flags"],
221
222    srcs: [
223        "vdc.cpp",
224        "Utils.cpp",
225    ],
226    shared_libs: [
227        "libbase",
228        "libbinder",
229        "libcutils",
230        "liblogwrap",
231        "libselinux",
232        "libutils",
233    ],
234    static_libs: [
235        "libvold_binder",
236    ],
237}
238
239cc_binary {
240    name: "secdiscard",
241    defaults: ["vold_default_flags"],
242
243    srcs: [
244        "FileDeviceUtils.cpp",
245        "secdiscard.cpp",
246    ],
247    shared_libs: ["libbase"],
248}
249
250cc_binary {
251    name: "vold_prepare_subdirs",
252    defaults: ["vold_default_flags"],
253
254    srcs: [
255        "vold_prepare_subdirs.cpp",
256        "Utils.cpp",
257    ],
258    shared_libs: [
259        "libbase",
260        "libcutils",
261        "liblogwrap",
262        "libselinux",
263        "libutils",
264    ],
265    static_libs: [
266        "libvold_binder",
267    ],
268}
269
270filegroup {
271    name: "vold_aidl",
272    srcs: [
273        "binder/android/os/IVold.aidl",
274        "binder/android/os/IVoldListener.aidl",
275        "binder/android/os/IVoldMountCallback.aidl",
276        "binder/android/os/IVoldTaskListener.aidl",
277    ],
278    path: "binder",
279}
280
281aconfig_declarations {
282    name: "vold_flags",
283    package: "android.vold.flags",
284    srcs: ["aconfig/flags.aconfig"],
285    container: "system",
286}
287
288cc_aconfig_library {
289    name: "vold_flags_c_lib",
290    aconfig_declarations: "vold_flags",
291}