Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 1 | // Copyright (C) 2018 The Android Open Source Project |
Steve Kondik | 432c6a0 | 2013-10-19 19:49:20 -0700 | [diff] [blame] | 2 | // Copyright (C) 2019 The LineageOS Project |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 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 | |
Bob Badour | 29be3f6 | 2021-02-12 18:00:57 -0800 | [diff] [blame] | 16 | // *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE |
| 17 | // CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE |
| 18 | // DEPENDING ON IT IN YOUR PROJECT. *** |
| 19 | package { |
| 20 | default_applicable_licenses: ["bootable_recovery_license"], |
| 21 | } |
| 22 | |
| 23 | // Added automatically by a large-scale-change that took the approach of |
| 24 | // 'apply every license found to every target'. While this makes sure we respect |
| 25 | // every license restriction, it may not be entirely correct. |
| 26 | // |
| 27 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 28 | // |
| 29 | // Please consider splitting the single license below into multiple licenses, |
| 30 | // taking care not to lose any license_kind information, and overriding the |
| 31 | // default license using the 'licenses: [...]' property on targets as needed. |
| 32 | // |
| 33 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 34 | // to attach the license to, and including a comment whether the files may be |
| 35 | // used in the current project. |
| 36 | // See: http://go/android-license-faq |
| 37 | license { |
| 38 | name: "bootable_recovery_license", |
| 39 | visibility: [":__subpackages__"], |
| 40 | license_kinds: [ |
| 41 | "SPDX-license-identifier-Apache-2.0", |
| 42 | "SPDX-license-identifier-MIT", |
| 43 | "SPDX-license-identifier-OFL", // by exception only |
| 44 | ], |
| 45 | license_text: [ |
| 46 | "NOTICE", |
| 47 | ], |
| 48 | } |
| 49 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 50 | cc_defaults { |
| 51 | name: "recovery_defaults", |
| 52 | |
| 53 | cflags: [ |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 54 | "-D_FILE_OFFSET_BITS=64", |
| 55 | |
| 56 | // Must be the same as RECOVERY_API_VERSION. |
| 57 | "-DRECOVERY_API_VERSION=3", |
| 58 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 59 | "-Wall", |
| 60 | "-Werror", |
| 61 | ], |
| 62 | } |
| 63 | |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 64 | cc_library_static { |
| 65 | name: "librecovery_fastboot", |
| 66 | recovery_available: true, |
| 67 | defaults: [ |
| 68 | "recovery_defaults", |
| 69 | ], |
| 70 | |
| 71 | srcs: [ |
| 72 | "fastboot/fastboot.cpp", |
| 73 | ], |
| 74 | |
| 75 | shared_libs: [ |
| 76 | "libbase", |
| 77 | "libbootloader_message", |
| 78 | "libcutils", |
| 79 | "liblog", |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 80 | "librecovery_ui", |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 81 | ], |
| 82 | |
| 83 | static_libs: [ |
| 84 | "librecovery_ui_default", |
| 85 | ], |
| 86 | } |
| 87 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 88 | cc_defaults { |
| 89 | name: "librecovery_defaults", |
| 90 | |
| 91 | defaults: [ |
| 92 | "recovery_defaults", |
| 93 | ], |
| 94 | |
| 95 | shared_libs: [ |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 96 | "android.hardware.boot@1.0", |
| 97 | "android.hardware.boot@1.1", |
Kelvin Zhang | fa554fe | 2022-04-01 14:17:10 -0700 | [diff] [blame] | 98 | "android.hardware.boot-V1-ndk", |
| 99 | "libboot_control_client", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 100 | "libbase", |
| 101 | "libbootloader_message", |
| 102 | "libcrypto", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 103 | "libcutils", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 104 | "libfs_mgr", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 105 | "liblp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 106 | "liblog", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 107 | "libprotobuf-cpp-lite", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 108 | "libziparchive", |
Tom Marshall | 3e10175 | 2019-01-04 14:37:31 -0800 | [diff] [blame] | 109 | "libvolume_manager", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 110 | ], |
| 111 | |
| 112 | static_libs: [ |
Tianjie Xu | 58a2769 | 2019-08-06 12:32:05 -0700 | [diff] [blame] | 113 | "libc++fs", |
Tao Bao | 0deed33 | 2019-04-08 11:26:11 -0700 | [diff] [blame] | 114 | "libinstall", |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 115 | "librecovery_fastboot", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 116 | "libminui", |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 117 | "librecovery_utils", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 118 | "libotautil", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 119 | "libsnapshot_nobinder", |
Kelvin Zhang | 58bbe3c | 2022-04-12 10:46:56 -0700 | [diff] [blame] | 120 | "libsnapshot_cow", |
| 121 | "liblz4", |
Kelvin Zhang | 04a9449 | 2023-02-15 16:59:29 -0800 | [diff] [blame] | 122 | "libzstd", |
Yifan Hong | acf7d1b | 2020-04-16 11:04:10 -0700 | [diff] [blame] | 123 | "update_metadata-protos", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 124 | ], |
| 125 | } |
| 126 | |
| 127 | cc_library_static { |
| 128 | name: "librecovery", |
| 129 | recovery_available: true, |
| 130 | |
| 131 | defaults: [ |
| 132 | "librecovery_defaults", |
| 133 | ], |
| 134 | |
| 135 | srcs: [ |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 136 | "recovery.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 137 | ], |
| 138 | |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 139 | shared_libs: [ |
| 140 | "librecovery_ui", |
| 141 | ], |
xunchang | 37304f3 | 2019-03-12 12:40:14 -0700 | [diff] [blame] | 142 | } |
| 143 | |
Tom Cherry | 24dd314 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 144 | prebuilt_etc { |
| 145 | name: "init_recovery.rc", |
| 146 | filename: "init.rc", |
| 147 | src: "etc/init.rc", |
| 148 | sub_dir: "init/hw", |
| 149 | recovery: true, |
| 150 | } |
| 151 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 152 | cc_binary { |
| 153 | name: "recovery", |
| 154 | recovery: true, |
| 155 | |
| 156 | defaults: [ |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 157 | "libinstall_defaults", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 158 | "librecovery_defaults", |
Tao Bao | 832c9cd | 2019-09-27 23:32:00 -0700 | [diff] [blame] | 159 | "librecovery_utils_defaults", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 160 | ], |
| 161 | |
| 162 | srcs: [ |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 163 | "recovery_main.cpp", |
Tom Marshall | 3e10175 | 2019-01-04 14:37:31 -0800 | [diff] [blame] | 164 | "volclient.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 165 | ], |
| 166 | |
| 167 | shared_libs: [ |
David Anderson | 8ee048d | 2023-11-17 20:30:02 -0800 | [diff] [blame] | 168 | "android.hardware.health-V3-ndk", // from librecovery_utils |
Kelvin Zhang | fa554fe | 2022-04-01 14:17:10 -0700 | [diff] [blame] | 169 | "android.hardware.boot-V1-ndk", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 170 | "librecovery_ui", |
| 171 | ], |
| 172 | |
| 173 | static_libs: [ |
Steve Kondik | 432c6a0 | 2013-10-19 19:49:20 -0700 | [diff] [blame] | 174 | "libc++fs", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 175 | "librecovery", |
| 176 | "librecovery_ui_default", |
| 177 | ], |
| 178 | |
| 179 | required: [ |
| 180 | "e2fsdroid.recovery", |
Tom Cherry | 24dd314 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 181 | "init_recovery.rc", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 182 | "librecovery_ui_ext", |
xunchang | 34690ce | 2019-04-05 16:16:07 -0700 | [diff] [blame] | 183 | "minadbd", |
Tao Bao | 7c074d9 | 2018-08-21 12:31:51 -0700 | [diff] [blame] | 184 | "mke2fs.conf.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 185 | "mke2fs.recovery", |
Steve Kondik | 432c6a0 | 2013-10-19 19:49:20 -0700 | [diff] [blame] | 186 | "mkshrc.recovery", |
| 187 | "reboot.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 188 | "recovery_deps", |
Tom Cherry | 24dd314 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 189 | "ueventd.rc.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 190 | ], |
| 191 | } |
| 192 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 193 | // The dynamic executable that runs after /data mounts. |
| 194 | cc_binary { |
| 195 | name: "recovery-persist", |
| 196 | |
| 197 | defaults: [ |
| 198 | "recovery_defaults", |
| 199 | ], |
| 200 | |
| 201 | srcs: [ |
| 202 | "recovery-persist.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 203 | ], |
| 204 | |
| 205 | shared_libs: [ |
| 206 | "libbase", |
| 207 | "liblog", |
| 208 | ], |
| 209 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 210 | static_libs: [ |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 211 | "librecovery_utils", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 212 | ], |
| 213 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 214 | init_rc: [ |
| 215 | "recovery-persist.rc", |
| 216 | ], |
| 217 | } |
| 218 | |
| 219 | // The dynamic executable that runs at init. |
| 220 | cc_binary { |
| 221 | name: "recovery-refresh", |
| 222 | |
| 223 | defaults: [ |
| 224 | "recovery_defaults", |
| 225 | ], |
| 226 | |
| 227 | srcs: [ |
| 228 | "recovery-refresh.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 229 | ], |
| 230 | |
| 231 | shared_libs: [ |
| 232 | "libbase", |
| 233 | "liblog", |
| 234 | ], |
| 235 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 236 | static_libs: [ |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 237 | "librecovery_utils", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 238 | ], |
| 239 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 240 | init_rc: [ |
| 241 | "recovery-refresh.rc", |
| 242 | ], |
| 243 | } |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 244 | |
| 245 | filegroup { |
| 246 | name: "res-testdata", |
| 247 | |
| 248 | srcs: [ |
| 249 | "res-*/images/*_text.png", |
| 250 | ], |
| 251 | } |