blob: 3c83aabbaf8867ef96554d538963e91cb1c69fc0 [file] [log] [blame]
Tom Cherry37b5ada2017-05-12 17:05:22 -07001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badourd69ad692021-02-16 19:02:14 -080017package {
18 default_applicable_licenses: ["system_core_fs_mgr_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34// See: http://go/android-license-faq
35license {
36 name: "system_core_fs_mgr_license",
37 visibility: [":__subpackages__"],
38 license_kinds: [
39 "SPDX-license-identifier-Apache-2.0",
40 "SPDX-license-identifier-MIT",
41 ],
42 // large-scale-change unable to identify any license_text files
43}
44
Tom Cherry37b5ada2017-05-12 17:05:22 -070045cc_defaults {
46 name: "fs_mgr_defaults",
47 sanitize: {
48 misc_undefined: ["integer"],
49 },
50 local_include_dirs: ["include/"],
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070051 cflags: [
52 "-Wall",
53 "-Werror",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070054 ],
Tom Cherry37b5ada2017-05-12 17:05:22 -070055}
56
David Anderson43482de2019-12-18 08:01:32 -080057cc_defaults {
58 name: "libfs_mgr_defaults",
Tom Cherry37b5ada2017-05-12 17:05:22 -070059 defaults: ["fs_mgr_defaults"],
60 export_include_dirs: ["include"],
61 include_dirs: ["system/vold"],
David Anderson43482de2019-12-18 08:01:32 -080062 cflags: [
63 "-D_FILE_OFFSET_BITS=64",
64 ],
Tom Cherry37b5ada2017-05-12 17:05:22 -070065 srcs: [
Bart Van Assche1a9cad82021-08-06 10:21:12 -070066 "blockdev.cpp",
David Andersonc6512132019-06-10 19:03:01 -070067 "file_wait.cpp",
Tom Cherry37b5ada2017-05-12 17:05:22 -070068 "fs_mgr.cpp",
Tom Cherry37b5ada2017-05-12 17:05:22 -070069 "fs_mgr_format.cpp",
Tom Cherry37b5ada2017-05-12 17:05:22 -070070 "fs_mgr_verity.cpp",
David Anderson62e5b202018-05-01 17:09:17 -070071 "fs_mgr_dm_linear.cpp",
Mark Salyzynb28389f2018-06-06 13:10:40 -070072 "fs_mgr_overlayfs.cpp",
Yifan Hongbf80e7d2018-12-03 13:46:56 -080073 "fs_mgr_roots.cpp",
Justin Yun6bab0a92018-10-29 18:31:48 +090074 "fs_mgr_vendor_overlay.cpp",
David Anderson43482de2019-12-18 08:01:32 -080075 ":libfiemap_srcs",
Jiyong Parke7df1f72017-06-28 11:17:30 +090076 ],
Tao Baoa9fad6c2018-07-25 13:07:31 -070077 shared_libs: [
Jiyong Parke7df1f72017-06-28 11:17:30 +090078 "libbase",
Jiyong Parke7df1f72017-06-28 11:17:30 +090079 "libcrypto",
Tao Bao7aa46082018-08-13 22:25:34 -070080 "libcrypto_utils",
Tao Baoa9fad6c2018-07-25 13:07:31 -070081 "libcutils",
Jiyong Parke7df1f72017-06-28 11:17:30 +090082 "libext4_utils",
Tao Bao7aa46082018-08-13 22:25:34 -070083 "libfec",
Tao Baoa9fad6c2018-07-25 13:07:31 -070084 "liblog",
David Andersonf792e412018-07-27 16:05:31 -070085 "liblp",
Tao Bao7aa46082018-08-13 22:25:34 -070086 "libselinux",
Tao Baoa9fad6c2018-07-25 13:07:31 -070087 ],
88 static_libs: [
Jiyong Parke7df1f72017-06-28 11:17:30 +090089 "libavb",
Bowgo Tsaic1bc2812018-11-26 17:49:23 +080090 "libfs_avb",
Jiyong Parke7df1f72017-06-28 11:17:30 +090091 "libfstab",
Sandeep Patil59f04ee2018-05-30 13:46:55 -070092 "libdm",
David Anderson0e330f12019-01-03 18:16:56 -080093 "libgsi",
Jiyong Parke7df1f72017-06-28 11:17:30 +090094 ],
95 export_static_lib_headers: [
Bowgo Tsaic1bc2812018-11-26 17:49:23 +080096 "libfs_avb",
Jiyong Parke7df1f72017-06-28 11:17:30 +090097 "libfstab",
Sandeep Patil59f04ee2018-05-30 13:46:55 -070098 "libdm",
David Andersonf792e412018-07-27 16:05:31 -070099 ],
100 export_shared_lib_headers: [
David Andersonea3b8ac2018-06-07 15:36:09 -0700101 "liblp",
Jiyong Parke7df1f72017-06-28 11:17:30 +0900102 ],
103 whole_static_libs: [
Jin Qian42d81372017-04-21 16:56:34 -0700104 "liblogwrap",
Sandeep Patil59f04ee2018-05-30 13:46:55 -0700105 "libdm",
David Anderson924858c2019-06-26 17:00:00 -0700106 "libext2_uuid",
Paul Crowley7160fc12019-10-25 17:12:45 -0700107 "libfscrypt",
Jiyong Parke7df1f72017-06-28 11:17:30 +0900108 "libfstab",
Tom Cherry37b5ada2017-05-12 17:05:22 -0700109 ],
Tom Cherry31121ca2017-10-10 13:30:57 -0700110 cppflags: [
Tom Cherry31121ca2017-10-10 13:30:57 -0700111 "-DALLOW_ADBD_DISABLE_VERITY=0",
112 ],
Tom Cherry37b5ada2017-05-12 17:05:22 -0700113 product_variables: {
114 debuggable: {
Tom Cherry31121ca2017-10-10 13:30:57 -0700115 cppflags: [
116 "-UALLOW_ADBD_DISABLE_VERITY",
117 "-DALLOW_ADBD_DISABLE_VERITY=1",
118 ],
Tom Cherry37b5ada2017-05-12 17:05:22 -0700119 },
Tom Cherry37b5ada2017-05-12 17:05:22 -0700120 },
David Anderson43482de2019-12-18 08:01:32 -0800121 header_libs: [
122 "libfiemap_headers",
David Andersonc13586f2019-12-17 21:06:15 -0800123 "libstorage_literals_headers",
David Anderson43482de2019-12-18 08:01:32 -0800124 ],
125 export_header_lib_headers: [
126 "libfiemap_headers",
127 ],
Alessio Balsini843820e2020-01-24 16:08:28 +0000128 required: [
129 "e2freefrag",
130 "e2fsdroid",
131 ],
David Anderson43482de2019-12-18 08:01:32 -0800132}
133
134// Two variants of libfs_mgr are provided: libfs_mgr and libfs_mgr_binder.
135// Use libfs_mgr in recovery, first-stage-init, or when libfiemap or overlayfs
136// is not used.
137//
138// Use libfs_mgr_binder when not in recovery/first-stage init, or when overlayfs
139// or libfiemap is needed. In this case, libfiemap will proxy over binder to
140// gsid.
141cc_library {
142 // Do not ever allow this library to be vendor_available as a shared library.
143 // It does not have a stable interface.
144 name: "libfs_mgr",
145 recovery_available: true,
146 defaults: [
147 "libfs_mgr_defaults",
148 ],
149 srcs: [
150 ":libfiemap_passthrough_srcs",
151 ],
152}
153
154cc_library {
155 // Do not ever allow this library to be vendor_available as a shared library.
156 // It does not have a stable interface.
157 name: "libfs_mgr_binder",
158 defaults: [
159 "libfs_mgr_defaults",
160 "libfiemap_binder_defaults",
161 ],
Tom Cherry37b5ada2017-05-12 17:05:22 -0700162}
Jiyong Parke7df1f72017-06-28 11:17:30 +0900163
164cc_library_static {
Tom Cherry066fcdf2018-08-14 12:57:05 -0700165 // Do not ever make this a shared library as long as it is vendor_available.
166 // It does not have a stable interface.
Jiyong Parke7df1f72017-06-28 11:17:30 +0900167 name: "libfstab",
168 vendor_available: true,
Jiyong Parka0e75042018-05-24 14:11:00 +0900169 recovery_available: true,
Bowgo Tsaifa416f92019-01-07 15:30:27 +0800170 host_supported: true,
Jiyong Parke7df1f72017-06-28 11:17:30 +0900171 defaults: ["fs_mgr_defaults"],
172 srcs: [
173 "fs_mgr_fstab.cpp",
174 "fs_mgr_boot_config.cpp",
175 "fs_mgr_slotselect.cpp",
176 ],
bohu91c4bd72019-01-11 14:25:58 -0800177 target: {
178 darwin: {
179 enabled: false,
180 },
Hung-ying Tyane7cb09d2020-07-03 14:26:59 +0800181 vendor: {
182 cflags: [
183 // Skipping entries in fstab should only be done in a system
184 // process as the config file is in /system_ext.
185 // Remove the op from the vendor variant.
186 "-DNO_SKIP_MOUNT",
187 ],
188 },
bohu91c4bd72019-01-11 14:25:58 -0800189 },
Jiyong Parke7df1f72017-06-28 11:17:30 +0900190 export_include_dirs: ["include_fstab"],
David Anderson0e330f12019-01-03 18:16:56 -0800191 header_libs: [
192 "libbase_headers",
193 "libgsi_headers",
194 ],
Jiyong Parke7df1f72017-06-28 11:17:30 +0900195}
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800196
197cc_binary {
198 name: "remount",
199 defaults: ["fs_mgr_defaults"],
Mark Salyzyn1188ce42019-01-25 11:05:40 -0800200 static_libs: [
201 "libavb_user",
Yo Chiangd5429102021-01-21 18:14:47 +0800202 "libgsid",
David Anderson8696a5d2020-06-10 23:50:02 -0700203 "libutils",
204 "libvold_binder",
Mark Salyzyn1188ce42019-01-25 11:05:40 -0800205 ],
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800206 shared_libs: [
Mark Salyzyn1188ce42019-01-25 11:05:40 -0800207 "libbootloader_message",
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800208 "libbase",
David Anderson8696a5d2020-06-10 23:50:02 -0700209 "libbinder",
Mark Salyzync3fc2aa2019-04-30 13:21:04 -0700210 "libcutils",
Mark Salyzyn4469fb12019-01-30 10:19:15 -0800211 "libcrypto",
Mark Salyzync3fc2aa2019-04-30 13:21:04 -0700212 "libext4_utils",
Mark Salyzyn4469fb12019-01-30 10:19:15 -0800213 "libfec",
David Andersonc13586f2019-12-17 21:06:15 -0800214 "libfs_mgr_binder",
Mark Salyzync3fc2aa2019-04-30 13:21:04 -0700215 "liblog",
216 "liblp",
217 "libselinux",
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800218 ],
Mark Salyzyn1188ce42019-01-25 11:05:40 -0800219 header_libs: [
220 "libcutils_headers",
221 ],
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800222 srcs: [
223 "fs_mgr_remount.cpp",
224 ],
225 cppflags: [
226 "-DALLOW_ADBD_DISABLE_VERITY=0",
227 ],
228 product_variables: {
229 debuggable: {
230 cppflags: [
231 "-UALLOW_ADBD_DISABLE_VERITY",
232 "-DALLOW_ADBD_DISABLE_VERITY=1",
233 ],
234 },
235 },
David Andersonc13586f2019-12-17 21:06:15 -0800236 required: [
237 "clean_scratch_files",
238 ],
239}
240
241cc_binary {
242 name: "clean_scratch_files",
243 defaults: ["fs_mgr_defaults"],
244 shared_libs: [
245 "libbase",
246 "libfs_mgr_binder",
247 ],
248 srcs: [
249 "clean_scratch_files.cpp",
250 ],
251 product_variables: {
252 debuggable: {
253 init_rc: [
254 "clean_scratch_files.rc",
255 ],
256 },
257 },
Mark Salyzyn6b3f5872019-02-20 08:32:36 -0800258}