Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 1 | // |
| 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 Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 17 | package { |
Bowgo Tsai | a8c6b9d | 2021-06-29 16:05:53 +0800 | [diff] [blame] | 18 | default_applicable_licenses: [ |
| 19 | "Android-Apache-2.0", |
| 20 | "system_core_fs_mgr_license", |
| 21 | ], |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | // Added automatically by a large-scale-change that took the approach of |
| 25 | // 'apply every license found to every target'. While this makes sure we respect |
| 26 | // every license restriction, it may not be entirely correct. |
| 27 | // |
| 28 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 29 | // |
| 30 | // Please consider splitting the single license below into multiple licenses, |
| 31 | // taking care not to lose any license_kind information, and overriding the |
| 32 | // default license using the 'licenses: [...]' property on targets as needed. |
| 33 | // |
| 34 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 35 | // to attach the license to, and including a comment whether the files may be |
| 36 | // used in the current project. |
| 37 | // See: http://go/android-license-faq |
| 38 | license { |
| 39 | name: "system_core_fs_mgr_license", |
| 40 | visibility: [":__subpackages__"], |
| 41 | license_kinds: [ |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 42 | "SPDX-license-identifier-MIT", |
| 43 | ], |
Bowgo Tsai | a8c6b9d | 2021-06-29 16:05:53 +0800 | [diff] [blame] | 44 | license_text: ["NOTICE"], |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 45 | } |
| 46 | |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 47 | cc_defaults { |
| 48 | name: "fs_mgr_defaults", |
| 49 | sanitize: { |
| 50 | misc_undefined: ["integer"], |
| 51 | }, |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 52 | cflags: [ |
| 53 | "-Wall", |
| 54 | "-Werror", |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 55 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 56 | } |
| 57 | |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 58 | cc_defaults { |
| 59 | name: "libfs_mgr_defaults", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 60 | defaults: ["fs_mgr_defaults"], |
| 61 | export_include_dirs: ["include"], |
David Anderson | 0733900 | 2023-07-14 12:30:35 -0700 | [diff] [blame] | 62 | local_include_dirs: ["include/"], |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 63 | cflags: [ |
| 64 | "-D_FILE_OFFSET_BITS=64", |
| 65 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 66 | srcs: [ |
Bart Van Assche | 0223cd8 | 2021-08-06 10:21:12 -0700 | [diff] [blame] | 67 | "blockdev.cpp", |
David Anderson | c651213 | 2019-06-10 19:03:01 -0700 | [diff] [blame] | 68 | "file_wait.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 69 | "fs_mgr.cpp", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 70 | "fs_mgr_format.cpp", |
David Anderson | 62e5b20 | 2018-05-01 17:09:17 -0700 | [diff] [blame] | 71 | "fs_mgr_dm_linear.cpp", |
Yifan Hong | bf80e7d | 2018-12-03 13:46:56 -0800 | [diff] [blame] | 72 | "fs_mgr_roots.cpp", |
David Anderson | f8f3b62 | 2023-07-13 09:25:11 -0700 | [diff] [blame] | 73 | "fs_mgr_overlayfs_control.cpp", |
| 74 | "fs_mgr_overlayfs_mount.cpp", |
Justin Yun | 6bab0a9 | 2018-10-29 18:31:48 +0900 | [diff] [blame] | 75 | "fs_mgr_vendor_overlay.cpp", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 76 | ":libfiemap_srcs", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 77 | ], |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 78 | shared_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 79 | "libbase", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 80 | "libcrypto", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 81 | "libcrypto_utils", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 82 | "libcutils", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 83 | "libext4_utils", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 84 | "libfec", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 85 | "liblog", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 86 | "liblp", |
Tao Bao | 7aa4608 | 2018-08-13 22:25:34 -0700 | [diff] [blame] | 87 | "libselinux", |
Tao Bao | a9fad6c | 2018-07-25 13:07:31 -0700 | [diff] [blame] | 88 | ], |
| 89 | static_libs: [ |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 90 | "libavb", |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 91 | "libfs_avb", |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 92 | "libgsi", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 93 | ], |
| 94 | export_static_lib_headers: [ |
Bowgo Tsai | c1bc281 | 2018-11-26 17:49:23 +0800 | [diff] [blame] | 95 | "libfs_avb", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 96 | "libfstab", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 97 | "libdm", |
David Anderson | f792e41 | 2018-07-27 16:05:31 -0700 | [diff] [blame] | 98 | ], |
| 99 | export_shared_lib_headers: [ |
David Anderson | ea3b8ac | 2018-06-07 15:36:09 -0700 | [diff] [blame] | 100 | "liblp", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 101 | ], |
| 102 | whole_static_libs: [ |
Jin Qian | 42d8137 | 2017-04-21 16:56:34 -0700 | [diff] [blame] | 103 | "liblogwrap", |
Sandeep Patil | 59f04ee | 2018-05-30 13:46:55 -0700 | [diff] [blame] | 104 | "libdm", |
David Anderson | 924858c | 2019-06-26 17:00:00 -0700 | [diff] [blame] | 105 | "libext2_uuid", |
Paul Crowley | 7160fc1 | 2019-10-25 17:12:45 -0700 | [diff] [blame] | 106 | "libfscrypt", |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 107 | "libfstab", |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 108 | ], |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 109 | cppflags: [ |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 110 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 111 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 112 | product_variables: { |
| 113 | debuggable: { |
Tom Cherry | 31121ca | 2017-10-10 13:30:57 -0700 | [diff] [blame] | 114 | cppflags: [ |
| 115 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 116 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 117 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 118 | }, |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 119 | }, |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 120 | header_libs: [ |
| 121 | "libfiemap_headers", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 122 | "libstorage_literals_headers", |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 123 | ], |
| 124 | export_header_lib_headers: [ |
| 125 | "libfiemap_headers", |
| 126 | ], |
Yi-Yo Chiang | db819f5 | 2021-07-30 22:22:29 +0800 | [diff] [blame] | 127 | target: { |
| 128 | platform: { |
| 129 | required: [ |
| 130 | "e2freefrag", |
| 131 | "e2fsdroid", |
| 132 | ], |
| 133 | }, |
| 134 | recovery: { |
| 135 | required: [ |
| 136 | "e2fsdroid.recovery", |
| 137 | ], |
| 138 | }, |
| 139 | }, |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | // Two variants of libfs_mgr are provided: libfs_mgr and libfs_mgr_binder. |
| 143 | // Use libfs_mgr in recovery, first-stage-init, or when libfiemap or overlayfs |
| 144 | // is not used. |
| 145 | // |
| 146 | // Use libfs_mgr_binder when not in recovery/first-stage init, or when overlayfs |
| 147 | // or libfiemap is needed. In this case, libfiemap will proxy over binder to |
| 148 | // gsid. |
| 149 | cc_library { |
| 150 | // Do not ever allow this library to be vendor_available as a shared library. |
| 151 | // It does not have a stable interface. |
| 152 | name: "libfs_mgr", |
Inseob Kim | 2e20058 | 2021-06-11 12:58:53 +0900 | [diff] [blame] | 153 | ramdisk_available: true, |
David Anderson | a07503a | 2021-07-23 10:50:24 -0700 | [diff] [blame] | 154 | vendor_ramdisk_available: true, |
David Anderson | 43482de | 2019-12-18 08:01:32 -0800 | [diff] [blame] | 155 | recovery_available: true, |
| 156 | defaults: [ |
| 157 | "libfs_mgr_defaults", |
| 158 | ], |
| 159 | srcs: [ |
| 160 | ":libfiemap_passthrough_srcs", |
| 161 | ], |
| 162 | } |
| 163 | |
| 164 | cc_library { |
| 165 | // Do not ever allow this library to be vendor_available as a shared library. |
| 166 | // It does not have a stable interface. |
| 167 | name: "libfs_mgr_binder", |
| 168 | defaults: [ |
| 169 | "libfs_mgr_defaults", |
| 170 | "libfiemap_binder_defaults", |
| 171 | ], |
Tom Cherry | 37b5ada | 2017-05-12 17:05:22 -0700 | [diff] [blame] | 172 | } |
Jiyong Park | e7df1f7 | 2017-06-28 11:17:30 +0900 | [diff] [blame] | 173 | |
David Anderson | c132bf8 | 2023-06-30 10:24:37 -0700 | [diff] [blame] | 174 | cc_library_static { |
| 175 | name: "libfs_mgr_file_wait", |
| 176 | defaults: ["fs_mgr_defaults"], |
| 177 | export_include_dirs: ["include"], |
| 178 | cflags: [ |
| 179 | "-D_FILE_OFFSET_BITS=64", |
| 180 | ], |
| 181 | srcs: [ |
| 182 | "file_wait.cpp", |
| 183 | ], |
| 184 | shared_libs: [ |
| 185 | "libbase", |
| 186 | ], |
| 187 | host_supported: true, |
| 188 | ramdisk_available: true, |
| 189 | vendor_ramdisk_available: true, |
| 190 | recovery_available: true, |
| 191 | } |
| 192 | |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 193 | cc_binary { |
| 194 | name: "remount", |
| 195 | defaults: ["fs_mgr_defaults"], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 196 | static_libs: [ |
| 197 | "libavb_user", |
Yo Chiang | d542910 | 2021-01-21 18:14:47 +0800 | [diff] [blame] | 198 | "libgsid", |
David Anderson | 8696a5d | 2020-06-10 23:50:02 -0700 | [diff] [blame] | 199 | "libvold_binder", |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 200 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 201 | shared_libs: [ |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 202 | "libbootloader_message", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 203 | "libbase", |
David Anderson | 8696a5d | 2020-06-10 23:50:02 -0700 | [diff] [blame] | 204 | "libbinder", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 205 | "libcutils", |
Mark Salyzyn | 4469fb1 | 2019-01-30 10:19:15 -0800 | [diff] [blame] | 206 | "libcrypto", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 207 | "libext4_utils", |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 208 | "libfs_mgr_binder", |
Mark Salyzyn | c3fc2aa | 2019-04-30 13:21:04 -0700 | [diff] [blame] | 209 | "liblog", |
| 210 | "liblp", |
| 211 | "libselinux", |
Pirama Arumuga Nainar | cdf919d | 2021-08-25 22:14:50 -0700 | [diff] [blame] | 212 | "libutils", |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 213 | ], |
Mark Salyzyn | 1188ce4 | 2019-01-25 11:05:40 -0800 | [diff] [blame] | 214 | header_libs: [ |
| 215 | "libcutils_headers", |
| 216 | ], |
Mark Salyzyn | 6b3f587 | 2019-02-20 08:32:36 -0800 | [diff] [blame] | 217 | srcs: [ |
| 218 | "fs_mgr_remount.cpp", |
| 219 | ], |
| 220 | cppflags: [ |
| 221 | "-DALLOW_ADBD_DISABLE_VERITY=0", |
| 222 | ], |
| 223 | product_variables: { |
| 224 | debuggable: { |
| 225 | cppflags: [ |
| 226 | "-UALLOW_ADBD_DISABLE_VERITY", |
| 227 | "-DALLOW_ADBD_DISABLE_VERITY=1", |
| 228 | ], |
David Anderson | c13586f | 2019-12-17 21:06:15 -0800 | [diff] [blame] | 229 | init_rc: [ |
| 230 | "clean_scratch_files.rc", |
| 231 | ], |
| 232 | }, |
| 233 | }, |
Yi-Yo Chiang | 6455f27 | 2021-11-02 21:37:03 +0800 | [diff] [blame] | 234 | symlinks: [ |
| 235 | "clean_scratch_files", |
Yi-Yo Chiang | ad06b40 | 2022-09-21 22:10:33 +0800 | [diff] [blame] | 236 | "disable-verity", |
Yi-Yo Chiang | e8d85b5 | 2022-10-31 19:45:11 +0800 | [diff] [blame] | 237 | "enable-verity", |
| 238 | "set-verity-state", |
Yi-Yo Chiang | ad06b40 | 2022-09-21 22:10:33 +0800 | [diff] [blame] | 239 | ], |
| 240 | } |