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