blob: 89dea906f35142e9f04b515dd569e9765bae0475 [file] [log] [blame]
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001//
2// Copyright (C) 2015 The Android Open Source Project
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//
16
Colin Cross606913a2017-11-14 13:05:37 -080017// AIDL interface between libupdate_engine and framework.jar
Bob Badour9b85a6c2021-02-12 21:28:32 -080018package {
19 default_applicable_licenses: ["system_update_engine_license"],
20}
21
22// Added automatically by a large-scale-change
23// See: http://go/android-license-faq
24license {
25 name: "system_update_engine_license",
26 visibility: [":__subpackages__"],
27 license_kinds: [
28 "SPDX-license-identifier-Apache-2.0",
29 ],
30 license_text: [
31 "NOTICE",
32 ],
33}
34
Colin Cross606913a2017-11-14 13:05:37 -080035filegroup {
36 name: "libupdate_engine_aidl",
37 srcs: [
38 "binder_bindings/android/os/IUpdateEngine.aidl",
39 "binder_bindings/android/os/IUpdateEngineCallback.aidl",
40 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -070041 path: "binder_bindings",
42}
43
44cc_defaults {
45 name: "ue_defaults",
46
47 cflags: [
Amin Hassani2e4eda52019-01-07 14:01:17 -080048 "-DBASE_VER=576279",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070049 "-DUSE_HWID_OVERRIDE=0",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070050 "-D_FILE_OFFSET_BITS=64",
51 "-D_POSIX_C_SOURCE=199309L",
52 "-Wa,--noexecstack",
53 "-Wall",
54 "-Werror",
55 "-Wextra",
56 "-Wformat=2",
57 "-Wno-psabi",
58 "-Wno-unused-parameter",
59 "-ffunction-sections",
60 "-fstack-protector-strong",
61 "-fvisibility=hidden",
Kelvin Zhangc5803b72021-09-02 09:06:16 -070062 "-g3",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070063 ],
64 cppflags: [
65 "-Wnon-virtual-dtor",
66 "-fno-strict-aliasing",
67 ],
68 include_dirs: ["system"],
69 local_include_dirs: ["client_library/include"],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -070070 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -070071 shared_libs: [
72 "libbrillo-stream",
73 "libbrillo",
74 "libchrome",
75 ],
76 ldflags: ["-Wl,--gc-sections"],
77
Dan Willemsenf5a904e2018-10-23 01:02:44 -070078 target: {
Sen Jiangb5f631d2018-12-18 16:59:57 -080079 android: {
80 cflags: [
81 "-DUSE_FEC=1",
82 ],
83 },
84 host: {
85 cflags: [
86 "-DUSE_FEC=0",
87 ],
88 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -070089 darwin: {
90 enabled: false,
91 },
92 },
93}
94
Kelvin Zhang9b10dba2020-09-25 17:09:11 -040095// libcow_operation_convert (type: library)
96// ========================================================
Kelvin Zhangeb8703b2020-12-10 14:17:21 -050097cc_library_static {
98 name: "libpayload_extent_utils",
99 defaults: [
100 "ue_defaults",
101 ],
102 host_supported: true,
103 recovery_available: true,
104 srcs: [
105 "payload_generator/extent_utils.cc",
106 ],
107 static_libs: [
108 "update_metadata-protos",
109 ],
110}
111
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400112cc_library {
113 name: "libcow_operation_convert",
114 host_supported: true,
115 recovery_available: true,
116 defaults: [
117 "ue_defaults",
118 "update_metadata-protos_exports",
119 ],
120 srcs: [
121 "common/cow_operation_convert.cc",
122 ],
123 static_libs: [
124 "libsnapshot_cow",
125 "update_metadata-protos",
126 "libpayload_extent_ranges",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500127 "libpayload_extent_utils",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400128 "libbrotli",
129 "libz",
130 ],
131}
132
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700133// update_metadata-protos (type: static_library)
134// ========================================================
135// Protobufs.
136cc_defaults {
137 name: "update_metadata-protos_exports",
138
139 shared_libs: ["libprotobuf-cpp-lite"],
140}
141
Devendra Singhi87484b02022-11-22 14:10:14 +0530142cc_defaults {
143 name: "update_metadata-protos-defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700144 host_supported: true,
Inseob Kim3cce62a2021-06-14 11:55:35 +0900145 ramdisk_available: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700146 recovery_available: true,
147
148 srcs: ["update_engine/update_metadata.proto"],
149 cflags: [
150 "-Wall",
151 "-Werror",
152 ],
153 proto: {
154 canonical_path_from_root: false,
155 export_proto_headers: true,
156 },
157}
158
Devendra Singhi87484b02022-11-22 14:10:14 +0530159cc_library_static {
160 name: "update_metadata-protos",
161 defaults: ["update_metadata-protos-defaults"],
162 proto: {
163 type: "lite",
164 },
165}
166
167cc_library_static {
168 name: "update_metadata-protos-full",
169 defaults: ["update_metadata-protos-defaults"],
170}
171
Kelvin Zhang73202a92022-06-02 10:19:54 -0700172python_library_host {
173 name: "update_metadata-protos-python",
174 srcs: ["update_metadata.proto"],
175 proto: {
176 canonical_path_from_root: false,
177 },
178}
179
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700180// libpayload_consumer (type: static_library)
181// ========================================================
182// The payload application component and common dependencies.
183cc_defaults {
Devendra Singhi87484b02022-11-22 14:10:14 +0530184 name: "libpayload_consumer_exports_defaults",
185 defaults: ["update_metadata-protos_exports",],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700186
187 static_libs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700188 "libxz",
189 "libbz",
190 "libbspatch",
191 "libbrotli",
192 "libfec_rs",
193 "libpuffpatch",
194 "libverity_tree",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400195 "libsnapshot_cow",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400196 "libbrotli",
197 "libz",
198 "libpayload_extent_ranges",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500199 "libpayload_extent_utils",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400200 "libcow_operation_convert",
Kelvin Zhang55624032021-12-20 12:13:24 -0800201 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800202 "liblz4patch",
Kelvin Zhang27757a22023-02-15 16:58:27 -0800203 "libzstd",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700204 ],
205 shared_libs: [
206 "libbase",
207 "libcrypto",
Sen Jiangb5f631d2018-12-18 16:59:57 -0800208 "libfec",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800209 "liblz4",
Tianjie99d570d2020-06-04 14:57:19 -0700210 "libziparchive",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700211 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700212}
213
Devendra Singhi87484b02022-11-22 14:10:14 +0530214cc_defaults {
215 name: "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700216 defaults: [
Devendra Singhi87484b02022-11-22 14:10:14 +0530217 "libpayload_consumer_exports_defaults"
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700218 ],
Devendra Singhi87484b02022-11-22 14:10:14 +0530219 static_libs: ["update_metadata-protos",],
220}
221
222cc_defaults {
223 name: "libpayload_consumer_exports_proto-full",
224 defaults: [
225 "libpayload_consumer_exports_defaults"
226 ],
227 static_libs: ["update_metadata-protos-full",],
228}
229
230cc_defaults {
231 name: "libpayload_consumer_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700232 host_supported: true,
233 recovery_available: true,
234
235 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700236 "aosp/platform_constants_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700237 "common/action_processor.cc",
238 "common/boot_control_stub.cc",
239 "common/clock.cc",
240 "common/constants.cc",
241 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800242 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700243 "common/error_code_utils.cc",
244 "common/file_fetcher.cc",
245 "common/hash_calculator.cc",
246 "common/http_common.cc",
247 "common/http_fetcher.cc",
248 "common/hwid_override.cc",
249 "common/multi_range_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700250 "common/prefs.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700251 "common/subprocess.cc",
252 "common/terminator.cc",
253 "common/utils.cc",
254 "payload_consumer/bzip_extent_writer.cc",
255 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700256 "payload_consumer/certificate_parser_android.cc",
Kelvin Zhang569c97e2020-10-26 12:12:24 -0400257 "payload_consumer/cow_writer_file_descriptor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700258 "payload_consumer/delta_performer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700259 "payload_consumer/extent_reader.cc",
260 "payload_consumer/extent_writer.cc",
261 "payload_consumer/file_descriptor.cc",
262 "payload_consumer/file_descriptor_utils.cc",
263 "payload_consumer/file_writer.cc",
264 "payload_consumer/filesystem_verifier_action.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -0500265 "payload_consumer/install_operation_executor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700266 "payload_consumer/install_plan.cc",
267 "payload_consumer/mount_history.cc",
268 "payload_consumer/payload_constants.cc",
269 "payload_consumer/payload_metadata.cc",
270 "payload_consumer/payload_verifier.cc",
Kelvin Zhang50bac652020-09-28 15:51:41 -0400271 "payload_consumer/partition_writer.cc",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400272 "payload_consumer/partition_writer_factory_android.cc",
273 "payload_consumer/vabc_partition_writer.cc",
Kelvin Zhang4bb49202021-07-08 21:39:05 -0400274 "payload_consumer/xor_extent_writer.cc",
Kelvin Zhangb1706762021-06-25 15:05:22 -0400275 "payload_consumer/block_extent_writer.cc",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400276 "payload_consumer/snapshot_extent_writer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700277 "payload_consumer/postinstall_runner_action.cc",
Kelvin Zhangab3ce602021-02-24 14:46:40 -0500278 "payload_consumer/verified_source_fd.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700279 "payload_consumer/verity_writer_android.cc",
280 "payload_consumer/xz_extent_writer.cc",
281 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700282 "payload_consumer/partition_update_generator_android.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700283 "update_status_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700284 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700285}
286
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000287cc_library_static {
Devendra Singhi87484b02022-11-22 14:10:14 +0530288 name: "libpayload_consumer",
289 defaults: [
290 "ue_defaults",
291 "libpayload_consumer_exports",
292 "libpayload_consumer_defaults",
293 ],
294}
295
296cc_library_static {
297 name: "libpayload_consumer_proto-full",
298 defaults: [
299 "ue_defaults",
300 "libpayload_consumer_exports_proto-full",
301 "libpayload_consumer_defaults",
302 ],
303}
304
305cc_library_static {
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000306 name: "libstatslog_ue",
307 generated_sources: ["statslog_ue.cpp"],
308 generated_headers: ["statslog_ue.h"],
309 export_generated_headers: ["statslog_ue.h"],
310 shared_libs: [
311 "libstatssocket",
312 ]
313}
314
315genrule {
316 name: "statslog_ue.h",
317 tools: ["stats-log-api-gen"],
318 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_ue.h --module update_engine --namespace chromeos_update_engine,statsd",
319 out: [
320 "statslog_ue.h",
321 ],
322}
323
324genrule {
325 name: "statslog_ue.cpp",
326 tools: ["stats-log-api-gen"],
327 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_ue.cpp --module update_engine --namespace chromeos_update_engine,statsd --importHeader statslog_ue.h",
328 out: [
329 "statslog_ue.cpp",
330 ],
331}
332
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700333// libupdate_engine_boot_control (type: static_library)
334// ========================================================
335// A BootControl class implementation using Android's HIDL boot_control HAL.
336cc_defaults {
Devendra Singhi87484b02022-11-22 14:10:14 +0530337 name: "libupdate_engine_boot_control_exports_defaults",
338 defaults: ["update_metadata-protos_exports",],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700339
Yifan Hong420db9b2019-07-23 20:50:33 -0700340 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800341 "libcutils",
342 "libfs_mgr_binder",
343 "libgsi",
David Anderson8f2f5292023-08-03 12:28:38 -0700344 "libsnapshot_static",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000345 "libstatslog_ue",
David Anderson6c190a22020-09-21 17:09:53 -0700346 "libz",
Yifan Hong420db9b2019-07-23 20:50:33 -0700347 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700348 shared_libs: [
349 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700350 "libhidlbase",
351 "liblp",
352 "libutils",
353 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700354 "android.hardware.boot@1.1",
Kelvin Zhangcb419e62021-06-16 13:56:47 -0400355 "android.hardware.boot@1.2",
Kelvin Zhang8251dc02022-06-14 09:46:46 -0700356 "android.hardware.boot-V1-ndk",
Kelvin Zhange9c1d372022-06-13 15:40:44 -0700357 "libboot_control_client",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700358 ],
Yifan Hong29692902020-03-26 12:47:05 -0700359 header_libs: [
360 "avb_headers",
361 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700362 target: {
363 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800364 static_libs: [
365 "libfs_mgr",
366 "libsnapshot_nobinder",
367 ],
368 exclude_static_libs: [
369 "libfs_mgr_binder",
David Anderson8f2f5292023-08-03 12:28:38 -0700370 "libsnapshot_static",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000371 "libstatslog_ue"
Yifan Hong212d7952020-02-04 11:08:08 -0800372 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700373 },
374 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700375}
376
Devendra Singhi87484b02022-11-22 14:10:14 +0530377cc_defaults {
378 name: "libupdate_engine_boot_control_exports",
379 defaults: [
380 "libupdate_engine_boot_control_exports_defaults",
381 ],
382 static_libs: [
383 "libpayload_consumer",
384 "update_metadata-protos",
385 ]
386}
387
388cc_defaults {
389 name: "libupdate_engine_boot_control_exports_proto-full",
390 defaults: [
391 "libupdate_engine_boot_control_exports_defaults",
392 ],
393 static_libs: [
394 "libpayload_consumer_proto-full",
395 "update_metadata-protos-full",
396 ]
397}
398
399cc_defaults {
400 name: "libupdate_engine_boot_control_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700401 defaults: [
402 "ue_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700403 ],
404 recovery_available: true,
405
406 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700407 "aosp/boot_control_android.cc",
408 "aosp/cleanup_previous_update_action.cc",
409 "aosp/dynamic_partition_control_android.cc",
410 "aosp/dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700411 ],
412}
413
Devendra Singhi87484b02022-11-22 14:10:14 +0530414cc_library_static {
415 name: "libupdate_engine_boot_control",
416 defaults: [
417 "libupdate_engine_boot_control_defaults",
418 "libupdate_engine_boot_control_exports",
419 "libpayload_consumer_exports",
420 ],
421}
422
423cc_library_static {
Nikita Putikhine788f952024-03-11 19:21:24 +0100424 name: "libupdate_engine_boot_control_nostats",
425 cflags: ["-DUE_DISABLE_STATS"],
426 defaults: [
427 "libupdate_engine_boot_control_defaults",
428 "libupdate_engine_boot_control_exports",
429 "libpayload_consumer_exports",
430 ],
431}
432
433cc_library_static {
Devendra Singhi87484b02022-11-22 14:10:14 +0530434 name: "libupdate_engine_boot_control_proto-full",
435 defaults: [
436 "libupdate_engine_boot_control_defaults",
437 "libupdate_engine_boot_control_exports_proto-full",
438 "libpayload_consumer_exports_proto-full",
439 ],
440}
441
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700442// libupdate_engine_android (type: static_library)
443// ========================================================
444// The main daemon static_library used in Android (non-Brillo). This only has a
445// loop to apply payloads provided by the upper layer via a Binder interface.
446cc_defaults {
Devendra Singhi87484b02022-11-22 14:10:14 +0530447 name: "libupdate_engine_android_exports_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700448 defaults: [
449 "ue_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700450 ],
451
452 static_libs: [
Tianjie838793d2021-01-14 22:05:13 -0800453 "libavb",
454 "libavb_user",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000455 "libgkiprops",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000456 "libstatslog_ue",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000457 "libPlatformProperties",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700458 ],
459 shared_libs: [
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000460 "apex_aidl_interface-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700461 "libandroid_net",
462 "libbase",
463 "libbinder",
464 "libbinderwrapper",
465 "libbootloader_message",
466 "libbrillo-binder",
467 "libcurl",
468 "libcutils",
Pawan Wagh39fe9822024-01-03 17:03:16 +0000469 "libupdate_engine_stable-V2-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700470 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700471 "libssl",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000472 "libstatssocket",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700473 "libutils",
474 ],
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100475 whole_static_libs: [
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000476 "libcom.android.sysprop.apex",
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100477 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700478}
479
Devendra Singhi87484b02022-11-22 14:10:14 +0530480cc_defaults {
481 name: "libupdate_engine_android_exports",
482 defaults: [
483 "libupdate_engine_android_exports_defaults",
484 "libupdate_engine_boot_control_exports",
485 "libpayload_consumer_exports",
486 ],
487 static_libs: [
488 "libpayload_consumer",
489 "libupdate_engine_boot_control",
490 ],
491}
492
493cc_defaults {
494 name: "libupdate_engine_android_exports_proto-full",
495 defaults: [
496 "libupdate_engine_android_exports_defaults",
497 "libupdate_engine_boot_control_exports_proto-full",
498 "libpayload_consumer_exports_proto-full",
499 ],
500 static_libs: [
501 "libpayload_consumer_proto-full",
502 "libupdate_engine_boot_control_proto-full",
503 ],
504}
505
Brian Daniels6d8a94d2024-10-02 17:16:49 -0400506aidl_interface {
507 name: "libupdate_engine_aidl_interface",
508 srcs: [
509 ":libupdate_engine_aidl",
510 ],
511 backend: {
512 cpp: {
513 enabled: false,
514 },
515 java: {
516 enabled: false,
517 },
518 ndk: {
519 enabled: false,
520 },
521 rust: {
522 enabled: true,
523 },
524 },
525 frozen: false,
526 unstable: true,
527}
528
Devendra Singhi87484b02022-11-22 14:10:14 +0530529cc_defaults {
530 name: "libupdate_engine_android_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700531 defaults: [
532 "ue_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700533 ],
534
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700535 aidl: {
536 local_include_dirs: ["binder_bindings"],
537 export_aidl_headers: true,
538 },
539
540 srcs: [
541 ":libupdate_engine_aidl",
Amin Hassani538bd592020-11-04 20:46:08 -0800542 "common/system_state.cc",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000543 "aosp/apex_handler_android.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700544 "aosp/binder_service_android.cc",
545 "aosp/binder_service_stable_android.cc",
546 "aosp/daemon_android.cc",
547 "aosp/daemon_state_android.cc",
548 "aosp/hardware_android.cc",
549 "aosp/logging_android.cc",
550 "aosp/network_selector_android.cc",
551 "aosp/update_attempter_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700552 "certificate_checker.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800553 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700554 "libcurl_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700555 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700556 "update_boot_flags_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700557 ],
558}
559
Devendra Singhi87484b02022-11-22 14:10:14 +0530560cc_library_static {
561 name: "libupdate_engine_android",
562 defaults: [
563 "libupdate_engine_android_defaults",
564 "libupdate_engine_android_exports",
565 ]
566}
567
568cc_library_static {
569 name: "libupdate_engine_android_proto-full",
570 defaults: [
571 "libupdate_engine_android_defaults",
572 "libupdate_engine_android_exports_proto-full",
573 ]
574}
575
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700576// update_engine (type: executable)
577// ========================================================
578// update_engine daemon.
579cc_binary {
580 name: "update_engine",
581 defaults: [
582 "ue_defaults",
583 "libupdate_engine_android_exports",
584 ],
585
Kelvin Zhang77cb1c62023-03-31 20:34:52 -0700586 static_libs: [
587 "libupdate_engine_android",
588 "libgflags",
589 ],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700590 required: [
Darren Krahn03c7be52023-11-30 15:40:12 -0800591 "cacerts",
Tianjie Xube4ea232019-10-15 18:08:31 -0700592 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700593 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700594
Amin Hassaniec7bc112020-10-29 16:47:58 -0700595 srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700596 init_rc: ["update_engine.rc"],
597}
598
Nikita Putikhine788f952024-03-11 19:21:24 +0100599// update_engine_nostats (type: executable)
600// ========================================================
601// update_engine daemon version without the stats integration.
602cc_binary {
603 name: "update_engine_nostats",
604 defaults: [
605 "ue_defaults",
606 "libupdate_engine_android_exports",
607 ],
608
609 static_libs: [
610 "libupdate_engine_android",
611 "libgflags",
612 "libupdate_engine_boot_control_nostats",
613 ],
614 required: [
615 "cacerts",
616 "otacerts",
617 ],
618
619 exclude_static_libs: [
620 "libstatslog_ue",
621 "libupdate_engine_boot_control"
622 ],
623
624 exclude_shared_libs: [
625 "libstatssocket",
626 ],
627
628 cflags: ["-DUE_DISABLE_STATS"],
629 srcs: [
630 "main.cc",
631 "common/metrics_reporter_stub.cc",
632 ],
633 init_rc: ["update_engine_nostats.rc"],
634}
635
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700636// update_engine_sideload (type: executable)
637// ========================================================
638// A binary executable equivalent to update_engine daemon that installs an update
639// from a local file directly instead of running in the background. Used in
640// recovery image.
641cc_binary {
642 name: "update_engine_sideload",
643 defaults: [
644 "ue_defaults",
645 "update_metadata-protos_exports",
646 "libupdate_engine_boot_control_exports",
647 "libpayload_consumer_exports",
648 ],
649 recovery: true,
650
Nikita Putikhine788f952024-03-11 19:21:24 +0100651 cflags: [
652 "-D_UE_SIDELOAD",
653 "-DUE_DISABLE_STATS",
654 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -0700655 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700656
657 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700658 "aosp/hardware_android.cc",
659 "aosp/logging_android.cc",
660 "aosp/sideload_main.cc",
661 "aosp/update_attempter_android.cc",
662 "common/metrics_reporter_stub.cc",
663 "common/network_selector_stub.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800664 "common/system_state.cc",
665 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700666 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700667 "update_boot_flags_action.cc",
668 "update_status_utils.cc",
669 ],
670
671 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
672 // as it doesn't look beneficial to be installed separately due to its size. Note
673 // that we explicitly request their recovery variants, so that the expected files
674 // will be used and installed.
675 shared_libs: [
676 "libbase",
677 "liblog",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800678 "liblz4",
Kelvin Zhang0dfaf402023-10-31 17:26:58 -0700679 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700680 ],
681 static_libs: [
682 "libpayload_consumer",
683 "libupdate_engine_boot_control",
684 "update_metadata-protos",
685
686 // We add the static versions of the shared libraries that are not installed to
687 // recovery image due to size concerns. Need to include all the static library
688 // dependencies of these static libraries.
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000689 "libgkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700690 "libevent",
691 "libmodpb64",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700692 "libbrillo-stream",
693 "libbrillo",
694 "libchrome",
695 ],
696 target: {
697 recovery: {
698 exclude_shared_libs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700699 "libbrillo-stream",
700 "libbrillo",
701 "libchrome",
702 ],
703 },
704 },
705
Tao Bao1e1c86c2019-04-18 10:48:32 -0700706 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700707 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700708 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700709}
710
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700711// update_engine_client (type: executable)
712// ========================================================
713// update_engine console client.
714cc_binary {
715 name: "update_engine_client",
716 defaults: ["ue_defaults"],
717
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700718 shared_libs: [
719 "libbinder",
720 "libbinderwrapper",
721 "libbrillo-binder",
722 "libutils",
723 ],
724
725 aidl: {
726 local_include_dirs: ["binder_bindings"],
727 },
728
729 srcs: [
730 ":libupdate_engine_aidl",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700731 "aosp/update_engine_client_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700732 "common/error_code_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700733 "update_status_utils.cc",
734 ],
735}
736
737// libpayload_generator (type: static_library)
738// ========================================================
739// server-side code. This is used for delta_generator and unittests but not
740// for any client code.
741cc_defaults {
742 name: "libpayload_generator_exports",
743 defaults: [
744 "libpayload_consumer_exports",
745 "update_metadata-protos_exports",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800746 "erofs-utils_export_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700747 ],
748
Tianjie37ae8562020-03-25 15:16:01 -0700749 header_libs: [
750 "bootimg_headers",
751 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700752 static_libs: [
753 "libavb",
754 "libbrotli",
755 "libbsdiff",
756 "libdivsufsort",
757 "libdivsufsort64",
758 "liblzma",
759 "libpayload_consumer",
760 "libpuffdiff",
Tianjiea69cfe22021-08-22 23:28:44 -0700761 "libzucchini",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700762 "libverity_tree",
763 "update_metadata-protos",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500764 "libpayload_extent_utils",
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500765 "libcow_size_estimator",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800766 "liberofs",
Kelvin Zhang702ce4c2022-07-14 10:43:22 -0700767 "libselinux",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800768 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800769 "liblz4diff",
Kelvin Zhang27757a22023-02-15 16:58:27 -0800770 "libzstd",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700771 ],
772 shared_libs: [
773 "libbase",
774 "libext2fs",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800775 // LZ4 has to be a shared lib, as we want to override it with
776 // LD_LIBRARY_PRELOAD later
777 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700778 ],
779}
780
781cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000782 name: "libpayload_extent_ranges",
783 defaults: [
784 "ue_defaults",
785 ],
786 host_supported: true,
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400787 recovery_available: true,
David Andersonc1c93052020-08-26 18:22:09 +0000788 srcs: [
789 "payload_generator/extent_ranges.cc",
790 ],
791 static_libs: [
792 "update_metadata-protos",
793 ],
794}
795
796cc_library_static {
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500797 name: "libcow_size_estimator",
798 defaults: [
799 "ue_defaults",
800 "update_metadata-protos_exports"
801 ],
802 host_supported: true,
803 recovery_available: true,
804 srcs: [
805 "payload_generator/cow_size_estimator.cc",
806 ],
807 static_libs: [
808 "update_metadata-protos",
809 "libbase",
810 "libsnapshot_cow",
811 "libcow_operation_convert",
812 ],
813}
814
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800815cc_defaults {
816 name: "liblz4diff_defaults",
817 static_libs: [
818 "lz4diff-protos",
819 "update_metadata-protos",
820 "libssl",
821 "libbsdiff",
822 "libpuffdiff",
823 ],
824 shared_libs: [
825 "liblz4",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800826 ],
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800827}
828
829cc_library_static {
830 name: "liblz4diff",
831 host_supported: true,
832 defaults: ["ue_defaults", "liblz4diff_defaults"],
833 srcs: [
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800834 "lz4diff/lz4diff.cc",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800835 "lz4diff/lz4diff_compress.cc",
836 ],
837}
838
839cc_library_static {
840 name: "liblz4patch",
841 host_supported: true,
842 recovery_available: true,
843 defaults: ["ue_defaults"],
844 static_libs: [
845 "lz4diff-protos",
846 "update_metadata-protos",
847 "libssl",
848 "libbspatch",
849 "libpuffpatch",
850 ],
851 shared_libs: [
852 "liblz4",
853 ],
854 srcs: [
855 "lz4diff/lz4patch.cc",
856 "lz4diff/lz4diff_compress.cc",
857 ],
858}
859
Kelvin Zhang35cff4f2021-12-08 16:06:00 -0800860cc_binary_host {
861 name: "lz4diff",
862 defaults: [
863 "ue_defaults",
864 "libpayload_generator_exports",
865 ],
866 static_libs: [
867 "libpayload_generator",
868 "liblz4diff",
869 "liblz4patch",
870 ],
871 srcs: [
872 "lz4diff/lz4diff_main.cc",
873 ],
874}
875
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500876cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700877 name: "libpayload_generator",
878 defaults: [
879 "ue_defaults",
880 "libpayload_generator_exports",
881 ],
882 host_supported: true,
883
884 srcs: [
Amin Hassani538bd592020-11-04 20:46:08 -0800885 "common/system_state.cc",
886 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700887 "payload_generator/ab_generator.cc",
888 "payload_generator/annotated_operation.cc",
889 "payload_generator/blob_file_writer.cc",
890 "payload_generator/block_mapping.cc",
891 "payload_generator/boot_img_filesystem.cc",
892 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700893 "payload_generator/deflate_utils.cc",
894 "payload_generator/delta_diff_generator.cc",
895 "payload_generator/delta_diff_utils.cc",
896 "payload_generator/ext2_filesystem.cc",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800897 "payload_generator/erofs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700898 "payload_generator/extent_ranges.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700899 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700900 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700901 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700902 "payload_generator/payload_file.cc",
903 "payload_generator/payload_generation_config_android.cc",
904 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700905 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700906 "payload_generator/payload_signer.cc",
907 "payload_generator/raw_filesystem.cc",
908 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700909 "payload_generator/xz_android.cc",
910 ],
911}
912
913// delta_generator (type: executable)
914// ========================================================
915// server-side delta generator.
916cc_binary_host {
917 name: "delta_generator",
918 defaults: [
919 "ue_defaults",
920 "libpayload_generator_exports",
921 "libpayload_consumer_exports",
922 ],
923
924 static_libs: [
925 "libavb_host_sysdeps",
926 "libpayload_consumer",
927 "libpayload_generator",
Kelvin Zhang77cb1c62023-03-31 20:34:52 -0700928 "libgflags",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700929 ],
930
931 srcs: ["payload_generator/generate_delta_main.cc"],
932}
933
934cc_test {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700935 host_supported: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700936 name: "ue_unittest_delta_generator",
937 defaults: [
938 "ue_defaults",
939 "libpayload_generator_exports",
940 "libpayload_consumer_exports",
941 ],
942
943 static_libs: [
944 "libpayload_consumer",
945 "libpayload_generator",
Kelvin Zhang77cb1c62023-03-31 20:34:52 -0700946 "libgflags",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700947 ],
948
949 srcs: ["payload_generator/generate_delta_main.cc"],
950
951 gtest: false,
952 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700953}
954
955// test_http_server (type: executable)
956// ========================================================
957// Test HTTP Server.
958cc_test {
959 name: "test_http_server",
960 defaults: ["ue_defaults"],
961 srcs: [
962 "common/http_common.cc",
963 "test_http_server.cc",
964 ],
965
966 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700967}
968
969// test_subprocess (type: executable)
970// ========================================================
971// Test helper subprocess program.
972cc_test {
973 name: "test_subprocess",
974 defaults: ["ue_defaults"],
975 srcs: ["test_subprocess.cc"],
976
977 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700978}
979
980// Public keys for unittests.
981// ========================================================
982genrule {
983 name: "ue_unittest_keys",
984 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700985 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700986 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
987 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700988 srcs: [
989 "unittest_key.pem",
990 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700991 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700992 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700993 ],
994 out: [
995 "unittest_key.pub.pem",
996 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700997 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700998 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700999 ],
1000}
1001
1002// Sample images for unittests.
1003// ========================================================
1004// Extract sample image from the compressed sample_images.tar.bz2 file used by
1005// the unittests.
1006genrule {
1007 name: "ue_unittest_disk_imgs",
1008 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
1009 srcs: ["sample_images/sample_images.tar.bz2"],
1010 out: [
1011 "gen/disk_ext2_1k.img",
1012 "gen/disk_ext2_4k.img",
1013 "gen/disk_ext2_4k_empty.img",
1014 "gen/disk_ext2_unittest.img",
1015 ],
1016}
1017
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001018genrule {
1019 name: "ue_unittest_erofs_imgs",
Kelvin Zhang893b3a12021-12-30 12:28:53 -08001020 cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " +
1021 "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " +
1022 "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001023 srcs: ["sample_images/generate_test_erofs_images.sh"],
1024 out: [
1025 "gen/erofs.img",
Kelvin Zhang893b3a12021-12-30 12:28:53 -08001026 "gen/erofs_new.img",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001027 "gen/erofs_empty.img",
1028 ],
1029 tools: [
1030 "mkfs.erofs",
1031 "delta_generator",
1032 ],
1033}
1034
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001035filegroup {
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001036 name: "update_engine_host_unittest_timeout_srcs",
1037 srcs: [
1038 "common/action_processor_unittest.cc",
1039 "common/file_fetcher_unittest.cc",
1040 "payload_generator/delta_diff_utils_unittest.cc",
1041 ],
1042}
1043
1044filegroup {
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001045 name: "update_engine_host_unittest_srcs",
1046 srcs: [
1047 "common/action_pipe_unittest.cc",
1048 "common/action_processor_unittest.cc",
1049 "common/action_unittest.cc",
1050 "common/cow_operation_convert_unittest.cc",
1051 "common/cpu_limiter_unittest.cc",
1052 "common/fake_prefs.cc",
1053 "common/file_fetcher_unittest.cc",
1054 "common/hash_calculator_unittest.cc",
1055 "common/hwid_override_unittest.cc",
1056 "common/metrics_reporter_stub.cc",
1057 "common/mock_http_fetcher.cc",
1058 "common/prefs_unittest.cc",
1059 "common/terminator_unittest.cc",
1060 "common/test_utils.cc",
Kelvin Zhang55624032021-12-20 12:13:24 -08001061 "lz4diff/lz4diff_compress_unittest.cc",
Kelvin Zhang893b3a12021-12-30 12:28:53 -08001062 "lz4diff/lz4diff_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001063 "payload_generator/ab_generator_unittest.cc",
1064 "payload_generator/blob_file_writer_unittest.cc",
1065 "payload_generator/block_mapping_unittest.cc",
1066 "payload_generator/boot_img_filesystem_unittest.cc",
1067 "payload_generator/deflate_utils_unittest.cc",
1068 "payload_generator/delta_diff_utils_unittest.cc",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001069 "payload_generator/erofs_filesystem_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001070 "payload_generator/ext2_filesystem_unittest.cc",
1071 "payload_generator/extent_ranges_unittest.cc",
1072 "payload_generator/extent_utils_unittest.cc",
1073 "payload_generator/fake_filesystem.cc",
1074 "payload_generator/full_update_generator_unittest.cc",
1075 "payload_generator/mapfile_filesystem_unittest.cc",
1076 "payload_generator/merge_sequence_generator_unittest.cc",
1077 "payload_generator/payload_file_unittest.cc",
1078 "payload_generator/payload_generation_config_android_unittest.cc",
1079 "payload_generator/payload_generation_config_unittest.cc",
1080 "payload_generator/payload_properties_unittest.cc",
1081 "payload_generator/payload_signer_unittest.cc",
1082 "payload_generator/squashfs_filesystem_unittest.cc",
1083 "payload_generator/zip_unittest.cc",
Kelvin Zhange4bffe62022-03-07 09:08:38 -08001084 "payload_consumer/verity_writer_android_unittest.cc",
1085 "payload_consumer/xz_extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001086 "testrunner.cc",
1087 ],
1088}
1089
1090cc_test_host {
1091 name: "update_engine_host_unittests",
1092 defaults: [
1093 "ue_defaults",
1094 "libpayload_generator_exports",
1095 ],
1096 strip: {
1097 none: true,
1098 },
1099 cflags: [
1100 "-g3",
1101 ],
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001102 tidy_timeout_srcs: [":update_engine_host_unittest_timeout_srcs"],
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001103 srcs: [":update_engine_host_unittest_srcs"],
1104 data: [
1105 ":ue_unittest_delta_generator",
1106 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001107 ":ue_unittest_erofs_imgs",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001108 ":ue_unittest_keys",
1109 "otacerts.zip",
1110 "unittest_key.pem",
1111 "unittest_key2.pem",
1112 "unittest_key_RSA4096.pem",
1113 "unittest_key_EC.pem",
1114 "update_engine.conf",
Kelvin Zhanga35324f2023-06-28 10:29:16 -07001115 "testdata/cycle_nodes_product.bin",
1116 "testdata/cycle_nodes_product_no_xor.bin",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001117 ],
1118 static_libs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001119 "libgmock",
1120 "libpayload_generator",
1121 ],
1122}
1123
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001124// update_engine_unittests (type: executable)
1125// ========================================================
1126// Main unittest file.
1127cc_test {
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001128 name: "update_engine_http_unittests",
1129 defaults: [
1130 "ue_defaults",
1131 "liblz4diff_defaults",
1132 "update_metadata-protos_exports",
1133 ],
1134 require_root: true,
1135 static_libs: [
1136 "libbase",
1137 "libbrillo-test-helpers",
1138 "libchrome_test_helpers",
1139 "libcurl",
1140 "libcutils",
1141 "libdm",
1142 "libgmock",
1143 "libz",
Kelvin Zhang27757a22023-02-15 16:58:27 -08001144 "libzstd",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001145 ],
1146 shared_libs: [
1147 "libssl",
1148 "libcrypto",
1149 "libziparchive",
1150 "liblog",
1151 ],
1152
1153 data: [
1154 ":test_http_server",
1155 ":test_subprocess",
1156 ":ue_unittest_keys",
1157 "otacerts.zip",
1158 "unittest_key.pem",
1159 "unittest_key2.pem",
1160 "unittest_key_RSA4096.pem",
1161 "unittest_key_EC.pem",
1162 ],
1163
1164 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1165 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1166 // test_config: "test_config.xml",
1167 test_suites: ["device-tests"],
1168
1169 srcs: [
1170 "aosp/platform_constants_android.cc",
1171 "certificate_checker.cc",
1172 "common/action_processor.cc",
1173 "common/boot_control_stub.cc",
1174 "common/error_code_utils.cc",
1175 "common/file_fetcher.cc",
1176 "common/hash_calculator.cc",
1177 "common/http_fetcher.cc",
1178 "common/multi_range_http_fetcher.cc",
1179 "common/http_common.cc",
1180 "common/subprocess.cc",
1181 "common/test_utils.cc",
1182 "common/utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001183 "libcurl_http_fetcher.cc",
1184 "payload_consumer/certificate_parser_android.cc",
1185 "payload_consumer/payload_verifier.cc",
1186 "payload_generator/payload_signer.cc",
1187 "update_status_utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001188 "certificate_checker_unittest.cc",
1189 "common/http_fetcher_unittest.cc",
1190 "common/mock_http_fetcher.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001191 "common/subprocess_unittest.cc",
1192 "libcurl_http_fetcher_unittest.cc",
1193 "payload_consumer/certificate_parser_android_unittest.cc",
1194 "update_status_utils_unittest.cc",
1195 ],
1196}
1197
1198// update_engine_unittests (type: executable)
1199// ========================================================
1200// Main unittest file.
1201cc_test {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001202 name: "update_engine_unittests",
1203 defaults: [
1204 "ue_defaults",
1205 "libpayload_generator_exports",
1206 "libupdate_engine_android_exports",
1207 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001208
1209 static_libs: [
1210 "libpayload_generator",
1211 "libbrillo-test-helpers",
1212 "libgmock",
1213 "libchrome_test_helpers",
1214 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -08001215 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001216 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001217
Yifan Hong87ea73f2019-09-12 13:07:37 -07001218 header_libs: [
1219 "libstorage_literals_headers",
1220 ],
1221
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001222 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -07001223 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001224 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001225 ":ue_unittest_erofs_imgs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001226 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -07001227 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001228 "unittest_key.pem",
1229 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -07001230 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -07001231 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001232 "update_engine.conf",
Kelvin Zhanga35324f2023-06-28 10:29:16 -07001233 "testdata/cycle_nodes_product.bin",
1234 "testdata/cycle_nodes_product_no_xor.bin",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001235 ],
1236
Tao Bao9456b6f2019-04-29 18:14:58 -07001237 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1238 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1239 test_config: "test_config.xml",
1240 test_suites: ["device-tests"],
1241
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001242 tidy_timeout_srcs: [
1243 ":update_engine_host_unittest_timeout_srcs",
1244 "aosp/dynamic_partition_control_android_unittest.cc",
1245 "common/http_fetcher_unittest.cc",
1246 "payload_consumer/delta_performer_integration_test.cc",
1247 "payload_consumer/delta_performer_unittest.cc",
1248 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001249 srcs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001250 ":update_engine_host_unittest_srcs",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +00001251 "aosp/apex_handler_android_unittest.cc",
Kelvin Zhangb4b95c22021-04-05 15:56:26 -04001252 "aosp/cleanup_previous_update_action_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001253 "aosp/dynamic_partition_control_android_unittest.cc",
Kelvin Zhang3fe49642021-10-04 15:35:02 -07001254 "aosp/update_attempter_android_integration_test.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001255 "aosp/update_attempter_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001256 "common/utils_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001257 "download_action_android_unittest.cc",
Kelvin Zhange47767a2023-05-16 13:00:58 -07001258 "payload_consumer/block_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001259 "payload_consumer/bzip_extent_writer_unittest.cc",
1260 "payload_consumer/cached_file_descriptor_unittest.cc",
Kelvin Zhang46d6c492021-04-26 17:51:25 -04001261 "payload_consumer/cow_writer_file_descriptor_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001262 "payload_consumer/delta_performer_integration_test.cc",
1263 "payload_consumer/delta_performer_unittest.cc",
1264 "payload_consumer/extent_reader_unittest.cc",
1265 "payload_consumer/extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001266 "payload_consumer/extent_map_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001267 "payload_consumer/fake_file_descriptor.cc",
1268 "payload_consumer/file_descriptor_utils_unittest.cc",
1269 "payload_consumer/file_writer_unittest.cc",
1270 "payload_consumer/filesystem_verifier_action_unittest.cc",
Amin Hassani23795032020-11-24 14:38:55 -08001271 "payload_consumer/install_plan_unittest.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -05001272 "payload_consumer/install_operation_executor_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -07001273 "payload_consumer/partition_update_generator_android_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001274 "payload_consumer/partition_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001275 "payload_consumer/postinstall_runner_action_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001276 "payload_consumer/snapshot_extent_writer_unittest.cc",
1277 "payload_consumer/vabc_partition_writer_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001278 "payload_consumer/xor_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001279 ],
1280}
1281
1282// Brillo update payload generation script
1283// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001284sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001285 name: "brillo_update_payload",
1286 device_supported: false,
1287 host_supported: true,
1288
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001289 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001290 required: [
1291 "delta_generator",
1292 "shflags",
1293 "simg2img",
1294 ],
1295
1296 target: {
1297 darwin: {
1298 enabled: false,
1299 },
1300 },
Colin Cross606913a2017-11-14 13:05:37 -08001301}
Yifan Hongd51738c2020-07-23 17:06:25 -07001302
1303// update_engine header library
1304cc_library_headers {
1305 name: "libupdate_engine_headers",
Yifan Hong309c8a82020-10-06 18:31:08 -07001306
1307 // This header library is available to core and product modules.
Justin Yun6d121de2020-11-11 19:31:57 +09001308 product_available: true,
Yifan Hong309c8a82020-10-06 18:31:08 -07001309
Yifan Hongd51738c2020-07-23 17:06:25 -07001310 export_include_dirs: ["."],
1311 apex_available: [
1312 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -07001313 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -07001314 ],
David Andersonc1c93052020-08-26 18:22:09 +00001315 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001316 recovery_available: true,
1317 ramdisk_available: true,
David Andersona4b7ba62023-05-10 21:41:37 -07001318 vendor_ramdisk_available: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001319
1320 target: {
1321 darwin: {
1322 enabled: false,
1323 },
1324 }
Yifan Hongd51738c2020-07-23 17:06:25 -07001325}
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001326
1327cc_binary_host {
1328 name: "cow_converter",
1329 defaults: [
1330 "ue_defaults",
1331 "libpayload_consumer_exports",
1332 ],
1333 srcs: [
1334 "aosp/cow_converter.cc",
1335 ],
1336 static_libs: [
1337 "liblog",
1338 "libbrotli",
1339 "libbase",
1340 "libcow_operation_convert",
1341 "libcow_size_estimator",
Kelvin Zhang901c7d52022-06-21 09:35:45 -07001342 "libgflags",
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001343 "libpayload_consumer",
1344 "libpayload_extent_ranges",
1345 "libpayload_extent_utils",
1346 "libsnapshot_cow",
1347 "libz",
1348 "update_metadata-protos",
1349 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -07001350}
Kelvin Zhang98001b22021-12-08 14:10:11 -08001351
1352cc_library_static {
1353 name: "lz4diff-protos",
1354 host_supported: true,
1355 ramdisk_available: true,
1356 recovery_available: true,
1357
1358 srcs: ["lz4diff/lz4diff.proto"],
1359 cflags: [
1360 "-Wall",
1361 "-Werror",
1362 ],
1363 proto: {
1364 canonical_path_from_root: false,
1365 export_proto_headers: true,
1366 },
1367}
Kelvin Zhang596a3202022-03-07 14:13:42 -08001368
1369cc_binary_host {
1370 name: "ota_extractor",
1371 defaults: [
1372 "ue_defaults",
1373 "libpayload_consumer_exports",
1374 ],
1375 srcs: [
1376 "aosp/ota_extractor.cc",
1377 ],
1378 static_libs: [
1379 "liblog",
1380 "libbrotli",
1381 "libbase",
1382 "libpayload_consumer",
1383 "libpayload_extent_ranges",
1384 "libpayload_extent_utils",
1385 "libz",
1386 "libgflags",
1387 "update_metadata-protos",
1388 ],
1389}
Kelvin Zhang83b594b2023-05-25 13:43:06 -07001390
1391cc_binary_host {
1392 name: "map_file_generator",
1393 defaults: [
1394 "ue_defaults",
1395 "libpayload_generator_exports",
1396 ],
1397 srcs: [
1398 "aosp/map_file_generator.cc",
1399 ],
1400 static_libs: [
1401 "liblog",
1402 "libbase",
1403 "libpayload_generator",
1404 "libpayload_extent_ranges",
1405 "libpayload_extent_utils",
1406 "libgflags",
Kelvin Zhang8bd5c4c2023-06-08 11:21:27 -07001407 "libsparse",
Kelvin Zhang83b594b2023-05-25 13:43:06 -07001408 "update_metadata-protos",
1409 ],
Kelvin Zhangdf9821b2023-06-12 10:04:34 -07001410 required: [
1411 "unsquashfs",
1412 ],
Kelvin Zhang83b594b2023-05-25 13:43:06 -07001413}
Pawan Waghdaa52652023-06-08 23:57:11 +00001414
1415cc_fuzz {
1416 name: "update_engine_service_fuzzer",
1417 defaults: [
1418 "ue_defaults",
1419 "libupdate_engine_android_exports",
1420 "service_fuzzer_defaults",
1421 "fuzzer_disable_leaks",
1422 ],
1423 static_libs: [
1424 "libupdate_engine_android",
1425 "libgflags",
1426 ],
1427 srcs: [
1428 "fuzzers/update_engine_service_fuzzer.cpp",
1429 "aosp/metrics_reporter_android.cc",
1430 ],
1431 fuzz_config: {
1432 triage_assignee: "waghpawan@google.com",
1433 cc: [
1434 "elsk@google.com",
1435 "zhangkelvin@google.com",
1436 ]
1437 },
1438}