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 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. *** 18package { 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 36license { 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 49cc_defaults { 50 name: "recovery_defaults", 51 52 cflags: [ 53 "-D_FILE_OFFSET_BITS=64", 54 55 // Must be the same as RECOVERY_API_VERSION. 56 "-DRECOVERY_API_VERSION=3", 57 58 "-Wall", 59 "-Werror", 60 ], 61} 62 63cc_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", 79 "librecovery_ui", 80 ], 81 82 static_libs: [ 83 "librecovery_ui_default", 84 ], 85} 86 87cc_defaults { 88 name: "librecovery_defaults", 89 90 defaults: [ 91 "recovery_defaults", 92 ], 93 94 shared_libs: [ 95 "android.hardware.boot@1.0", 96 "android.hardware.boot@1.1", 97 "android.hardware.boot-V1-ndk", 98 "libboot_control_client", 99 "libbase", 100 "libbootloader_message", 101 "libcrypto", 102 "libcutils", 103 "libfs_mgr", 104 "liblp", 105 "liblog", 106 "libprotobuf-cpp-lite", 107 "libziparchive", 108 ], 109 110 static_libs: [ 111 "libc++fs", 112 "libinstall", 113 "librecovery_fastboot", 114 "libminui", 115 "librecovery_utils", 116 "libotautil", 117 "libsnapshot_nobinder", 118 "libsnapshot_cow", 119 "liblz4", 120 "libzstd", 121 "update_metadata-protos", 122 ], 123} 124 125cc_library_static { 126 name: "librecovery", 127 recovery_available: true, 128 129 defaults: [ 130 "librecovery_defaults", 131 ], 132 133 srcs: [ 134 "recovery.cpp", 135 ], 136 137 shared_libs: [ 138 "librecovery_ui", 139 ], 140} 141 142prebuilt_etc { 143 name: "init_recovery.rc", 144 filename: "init.rc", 145 src: "etc/init.rc", 146 sub_dir: "init/hw", 147 recovery: true, 148} 149 150cc_binary { 151 name: "recovery", 152 recovery: true, 153 154 defaults: [ 155 "libinstall_defaults", 156 "librecovery_defaults", 157 "librecovery_utils_defaults", 158 ], 159 160 srcs: [ 161 "recovery_main.cpp", 162 ], 163 164 shared_libs: [ 165 "android.hardware.health-V2-ndk", // from librecovery_utils 166 "android.hardware.boot-V1-ndk", 167 "librecovery_ui", 168 ], 169 170 static_libs: [ 171 "librecovery", 172 "librecovery_ui_default", 173 ], 174 175 required: [ 176 "e2fsdroid.recovery", 177 "init_recovery.rc", 178 "librecovery_ui_ext", 179 "minadbd", 180 "mke2fs.conf.recovery", 181 "mke2fs.recovery", 182 "recovery_deps", 183 "ueventd.rc.recovery", 184 ], 185} 186 187// The dynamic executable that runs after /data mounts. 188cc_binary { 189 name: "recovery-persist", 190 191 defaults: [ 192 "recovery_defaults", 193 ], 194 195 srcs: [ 196 "recovery-persist.cpp", 197 ], 198 199 shared_libs: [ 200 "libbase", 201 "liblog", 202 ], 203 204 static_libs: [ 205 "librecovery_utils", 206 ], 207 208 init_rc: [ 209 "recovery-persist.rc", 210 ], 211} 212 213// The dynamic executable that runs at init. 214cc_binary { 215 name: "recovery-refresh", 216 217 defaults: [ 218 "recovery_defaults", 219 ], 220 221 srcs: [ 222 "recovery-refresh.cpp", 223 ], 224 225 shared_libs: [ 226 "libbase", 227 "liblog", 228 ], 229 230 static_libs: [ 231 "librecovery_utils", 232 ], 233 234 init_rc: [ 235 "recovery-refresh.rc", 236 ], 237} 238 239filegroup { 240 name: "res-testdata", 241 242 srcs: [ 243 "res-*/images/*_text.png", 244 ], 245} 246