blob: 81de7779e768f303d4f6c22566f589ca0e32995c [file] [log] [blame]
Tao Baod2f2ad62018-03-23 23:24:25 -07001// 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 Badour29be3f62021-02-12 18:00:57 -080015// *** 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
Tao Baod2f2ad62018-03-23 23:24:25 -070049cc_defaults {
50 name: "recovery_defaults",
51
52 cflags: [
Tao Bao818f9382018-08-06 15:52:24 -070053 "-D_FILE_OFFSET_BITS=64",
54
55 // Must be the same as RECOVERY_API_VERSION.
56 "-DRECOVERY_API_VERSION=3",
57
Tao Baod2f2ad62018-03-23 23:24:25 -070058 "-Wall",
59 "-Werror",
60 ],
61}
62
Hridya Valsaraju20c81b32018-07-27 22:09:12 -070063cc_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 Xu8f397302018-08-20 13:40:47 -070079 "librecovery_ui",
Hridya Valsaraju20c81b32018-07-27 22:09:12 -070080 ],
81
82 static_libs: [
83 "librecovery_ui_default",
84 ],
85}
86
Tao Bao5fc72a12018-08-07 14:38:51 -070087cc_defaults {
88 name: "librecovery_defaults",
89
90 defaults: [
91 "recovery_defaults",
92 ],
93
94 shared_libs: [
David Anderson89d2d052019-10-15 13:22:20 -070095 "android.hardware.boot@1.0",
96 "android.hardware.boot@1.1",
Kelvin Zhangfa554fe2022-04-01 14:17:10 -070097 "android.hardware.boot-V1-ndk",
98 "libboot_control_client",
Tao Bao5fc72a12018-08-07 14:38:51 -070099 "libbase",
100 "libbootloader_message",
101 "libcrypto",
Tao Bao5fc72a12018-08-07 14:38:51 -0700102 "libcutils",
Tao Bao5fc72a12018-08-07 14:38:51 -0700103 "libfs_mgr",
David Anderson89d2d052019-10-15 13:22:20 -0700104 "liblp",
Tao Bao5fc72a12018-08-07 14:38:51 -0700105 "liblog",
David Anderson89d2d052019-10-15 13:22:20 -0700106 "libprotobuf-cpp-lite",
Tao Bao5fc72a12018-08-07 14:38:51 -0700107 "libziparchive",
108 ],
109
110 static_libs: [
Tianjie Xu58a27692019-08-06 12:32:05 -0700111 "libc++fs",
Tao Bao0deed332019-04-08 11:26:11 -0700112 "libinstall",
Hridya Valsaraju20c81b32018-07-27 22:09:12 -0700113 "librecovery_fastboot",
Tao Bao5fc72a12018-08-07 14:38:51 -0700114 "libminui",
Tao Baoe3f09a72019-10-01 11:55:36 -0700115 "librecovery_utils",
Tao Bao5fc72a12018-08-07 14:38:51 -0700116 "libotautil",
David Anderson89d2d052019-10-15 13:22:20 -0700117 "libsnapshot_nobinder",
Yifan Hongacf7d1b2020-04-16 11:04:10 -0700118 "update_metadata-protos",
Tao Bao5fc72a12018-08-07 14:38:51 -0700119 ],
120}
121
122cc_library_static {
123 name: "librecovery",
124 recovery_available: true,
125
126 defaults: [
127 "librecovery_defaults",
128 ],
129
130 srcs: [
Tao Bao5fc72a12018-08-07 14:38:51 -0700131 "recovery.cpp",
Tao Bao5fc72a12018-08-07 14:38:51 -0700132 ],
133
Tianjie Xu8f397302018-08-20 13:40:47 -0700134 shared_libs: [
135 "librecovery_ui",
136 ],
xunchang37304f32019-03-12 12:40:14 -0700137}
138
Tom Cherry24dd3142019-11-04 15:17:17 -0800139prebuilt_etc {
140 name: "init_recovery.rc",
141 filename: "init.rc",
142 src: "etc/init.rc",
143 sub_dir: "init/hw",
144 recovery: true,
145}
146
Tao Bao5fc72a12018-08-07 14:38:51 -0700147cc_binary {
148 name: "recovery",
149 recovery: true,
150
151 defaults: [
xunchang24788852019-03-22 16:08:52 -0700152 "libinstall_defaults",
Tao Bao5fc72a12018-08-07 14:38:51 -0700153 "librecovery_defaults",
Tao Bao832c9cd2019-09-27 23:32:00 -0700154 "librecovery_utils_defaults",
Tao Bao5fc72a12018-08-07 14:38:51 -0700155 ],
156
157 srcs: [
Tao Bao5fc72a12018-08-07 14:38:51 -0700158 "recovery_main.cpp",
159 ],
160
161 shared_libs: [
Yifan Hong67a8fd22021-11-30 16:39:00 -0800162 "android.hardware.health-V1-ndk", // from librecovery_utils
Kelvin Zhangfa554fe2022-04-01 14:17:10 -0700163 "android.hardware.boot-V1-ndk",
Tao Bao5fc72a12018-08-07 14:38:51 -0700164 "librecovery_ui",
165 ],
166
167 static_libs: [
168 "librecovery",
169 "librecovery_ui_default",
170 ],
171
172 required: [
173 "e2fsdroid.recovery",
Tom Cherry24dd3142019-11-04 15:17:17 -0800174 "init_recovery.rc",
Tao Bao5fc72a12018-08-07 14:38:51 -0700175 "librecovery_ui_ext",
xunchang34690ce2019-04-05 16:16:07 -0700176 "minadbd",
Tao Bao7c074d92018-08-21 12:31:51 -0700177 "mke2fs.conf.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700178 "mke2fs.recovery",
179 "recovery_deps",
Tom Cherry24dd3142019-11-04 15:17:17 -0800180 "ueventd.rc.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700181 ],
182}
183
Tao Baod2f2ad62018-03-23 23:24:25 -0700184// The dynamic executable that runs after /data mounts.
185cc_binary {
186 name: "recovery-persist",
187
188 defaults: [
189 "recovery_defaults",
190 ],
191
192 srcs: [
193 "recovery-persist.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700194 ],
195
196 shared_libs: [
197 "libbase",
198 "liblog",
199 ],
200
Jerry Zhang152933a2018-05-02 16:56:00 -0700201 static_libs: [
Tao Baoe3f09a72019-10-01 11:55:36 -0700202 "librecovery_utils",
Jerry Zhang152933a2018-05-02 16:56:00 -0700203 ],
204
Tao Baod2f2ad62018-03-23 23:24:25 -0700205 init_rc: [
206 "recovery-persist.rc",
207 ],
208}
209
210// The dynamic executable that runs at init.
211cc_binary {
212 name: "recovery-refresh",
213
214 defaults: [
215 "recovery_defaults",
216 ],
217
218 srcs: [
219 "recovery-refresh.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700220 ],
221
222 shared_libs: [
223 "libbase",
224 "liblog",
225 ],
226
Jerry Zhang152933a2018-05-02 16:56:00 -0700227 static_libs: [
Tao Baoe3f09a72019-10-01 11:55:36 -0700228 "librecovery_utils",
Jerry Zhang152933a2018-05-02 16:56:00 -0700229 ],
230
Tao Baod2f2ad62018-03-23 23:24:25 -0700231 init_rc: [
232 "recovery-refresh.rc",
233 ],
234}
Tao Baoef5e38f2018-07-24 15:34:39 -0700235
236filegroup {
237 name: "res-testdata",
238
239 srcs: [
240 "res-*/images/*_text.png",
241 ],
242}