blob: 92a1515d7dc582fb48f2a3b5222ddaa3de603ada [file] [log] [blame]
Tao Baod2f2ad62018-03-23 23:24:25 -07001// Copyright (C) 2018 The Android Open Source Project
Steve Kondika90d0162013-10-19 19:49:20 -07002// Copyright (C) 2019 The LineageOS Project
Tao Baod2f2ad62018-03-23 23:24:25 -07003//
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 Badour29be3f62021-02-12 18:00:57 -080016// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
17// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
18// DEPENDING ON IT IN YOUR PROJECT. ***
19package {
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
37license {
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 Baod2f2ad62018-03-23 23:24:25 -070050cc_defaults {
51 name: "recovery_defaults",
52
53 cflags: [
Tao Bao818f9382018-08-06 15:52:24 -070054 "-D_FILE_OFFSET_BITS=64",
55
56 // Must be the same as RECOVERY_API_VERSION.
57 "-DRECOVERY_API_VERSION=3",
58
Tao Baod2f2ad62018-03-23 23:24:25 -070059 "-Wall",
60 "-Werror",
61 ],
62}
63
Hridya Valsaraju20c81b32018-07-27 22:09:12 -070064cc_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 Xu8f397302018-08-20 13:40:47 -070080 "librecovery_ui",
Hridya Valsaraju20c81b32018-07-27 22:09:12 -070081 ],
82
83 static_libs: [
84 "librecovery_ui_default",
85 ],
86}
87
Tao Bao5fc72a12018-08-07 14:38:51 -070088cc_defaults {
89 name: "librecovery_defaults",
90
91 defaults: [
92 "recovery_defaults",
93 ],
94
95 shared_libs: [
David Anderson89d2d052019-10-15 13:22:20 -070096 "android.hardware.boot@1.0",
97 "android.hardware.boot@1.1",
Tao Bao5fc72a12018-08-07 14:38:51 -070098 "libbase",
99 "libbootloader_message",
100 "libcrypto",
Tao Bao5fc72a12018-08-07 14:38:51 -0700101 "libcutils",
Tao Bao5fc72a12018-08-07 14:38:51 -0700102 "libfs_mgr",
David Anderson89d2d052019-10-15 13:22:20 -0700103 "liblp",
Tao Bao5fc72a12018-08-07 14:38:51 -0700104 "liblog",
David Anderson89d2d052019-10-15 13:22:20 -0700105 "libprotobuf-cpp-lite",
Tao Bao5fc72a12018-08-07 14:38:51 -0700106 "libziparchive",
107 ],
108
109 static_libs: [
Tianjie Xu58a27692019-08-06 12:32:05 -0700110 "libc++fs",
Tao Bao0deed332019-04-08 11:26:11 -0700111 "libinstall",
Hridya Valsaraju20c81b32018-07-27 22:09:12 -0700112 "librecovery_fastboot",
Tao Bao5fc72a12018-08-07 14:38:51 -0700113 "libminui",
Tao Baoe3f09a72019-10-01 11:55:36 -0700114 "librecovery_utils",
Tao Bao5fc72a12018-08-07 14:38:51 -0700115 "libotautil",
David Anderson89d2d052019-10-15 13:22:20 -0700116 "libsnapshot_nobinder",
Yifan Hongacf7d1b2020-04-16 11:04:10 -0700117 "update_metadata-protos",
Tao Bao5fc72a12018-08-07 14:38:51 -0700118 ],
119}
120
121cc_library_static {
122 name: "librecovery",
123 recovery_available: true,
124
125 defaults: [
126 "librecovery_defaults",
127 ],
128
129 srcs: [
Tao Bao5fc72a12018-08-07 14:38:51 -0700130 "recovery.cpp",
Tao Bao5fc72a12018-08-07 14:38:51 -0700131 ],
132
Tianjie Xu8f397302018-08-20 13:40:47 -0700133 shared_libs: [
134 "librecovery_ui",
135 ],
xunchang37304f32019-03-12 12:40:14 -0700136}
137
Tom Cherry24dd3142019-11-04 15:17:17 -0800138prebuilt_etc {
139 name: "init_recovery.rc",
140 filename: "init.rc",
141 src: "etc/init.rc",
142 sub_dir: "init/hw",
143 recovery: true,
144}
145
Tao Bao5fc72a12018-08-07 14:38:51 -0700146cc_binary {
147 name: "recovery",
148 recovery: true,
149
150 defaults: [
xunchang24788852019-03-22 16:08:52 -0700151 "libinstall_defaults",
Tao Bao5fc72a12018-08-07 14:38:51 -0700152 "librecovery_defaults",
Tao Bao832c9cd2019-09-27 23:32:00 -0700153 "librecovery_utils_defaults",
Tao Bao5fc72a12018-08-07 14:38:51 -0700154 ],
155
156 srcs: [
Tao Bao5fc72a12018-08-07 14:38:51 -0700157 "recovery_main.cpp",
158 ],
159
160 shared_libs: [
Yifan Hong67a8fd22021-11-30 16:39:00 -0800161 "android.hardware.health-V1-ndk", // from librecovery_utils
Tao Bao5fc72a12018-08-07 14:38:51 -0700162 "librecovery_ui",
163 ],
164
165 static_libs: [
Steve Kondika90d0162013-10-19 19:49:20 -0700166 "libc++fs",
Tao Bao5fc72a12018-08-07 14:38:51 -0700167 "librecovery",
168 "librecovery_ui_default",
169 ],
170
171 required: [
172 "e2fsdroid.recovery",
Tom Cherry24dd3142019-11-04 15:17:17 -0800173 "init_recovery.rc",
Tao Bao5fc72a12018-08-07 14:38:51 -0700174 "librecovery_ui_ext",
xunchang34690ce2019-04-05 16:16:07 -0700175 "minadbd",
Tao Bao7c074d92018-08-21 12:31:51 -0700176 "mke2fs.conf.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700177 "mke2fs.recovery",
Steve Kondika90d0162013-10-19 19:49:20 -0700178 "mkshrc.recovery",
179 "reboot.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700180 "recovery_deps",
Tom Cherry24dd3142019-11-04 15:17:17 -0800181 "ueventd.rc.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700182 ],
183}
184
Tao Baod2f2ad62018-03-23 23:24:25 -0700185// The dynamic executable that runs after /data mounts.
186cc_binary {
187 name: "recovery-persist",
188
189 defaults: [
190 "recovery_defaults",
191 ],
192
193 srcs: [
194 "recovery-persist.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700195 ],
196
197 shared_libs: [
198 "libbase",
199 "liblog",
200 ],
201
Jerry Zhang152933a2018-05-02 16:56:00 -0700202 static_libs: [
Tao Baoe3f09a72019-10-01 11:55:36 -0700203 "librecovery_utils",
Jerry Zhang152933a2018-05-02 16:56:00 -0700204 ],
205
Tao Baod2f2ad62018-03-23 23:24:25 -0700206 init_rc: [
207 "recovery-persist.rc",
208 ],
209}
210
211// The dynamic executable that runs at init.
212cc_binary {
213 name: "recovery-refresh",
214
215 defaults: [
216 "recovery_defaults",
217 ],
218
219 srcs: [
220 "recovery-refresh.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700221 ],
222
223 shared_libs: [
224 "libbase",
225 "liblog",
226 ],
227
Jerry Zhang152933a2018-05-02 16:56:00 -0700228 static_libs: [
Tao Baoe3f09a72019-10-01 11:55:36 -0700229 "librecovery_utils",
Jerry Zhang152933a2018-05-02 16:56:00 -0700230 ],
231
Tao Baod2f2ad62018-03-23 23:24:25 -0700232 init_rc: [
233 "recovery-refresh.rc",
234 ],
235}
Tao Baoef5e38f2018-07-24 15:34:39 -0700236
237filegroup {
238 name: "res-testdata",
239
240 srcs: [
241 "res-*/images/*_text.png",
242 ],
243}