blob: 15ba96a5fc6bf7ad24f5ea6e6c227c33c85c54a3 [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
78 product_variables: {
79 pdk: {
80 enabled: false,
81 },
82 },
83
84 target: {
Sen Jiangb5f631d2018-12-18 16:59:57 -080085 android: {
86 cflags: [
87 "-DUSE_FEC=1",
88 ],
89 },
90 host: {
91 cflags: [
92 "-DUSE_FEC=0",
93 ],
94 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -070095 darwin: {
96 enabled: false,
97 },
98 },
99}
100
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400101// libcow_operation_convert (type: library)
102// ========================================================
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500103cc_library_static {
104 name: "libpayload_extent_utils",
105 defaults: [
106 "ue_defaults",
107 ],
108 host_supported: true,
109 recovery_available: true,
110 srcs: [
111 "payload_generator/extent_utils.cc",
112 ],
113 static_libs: [
114 "update_metadata-protos",
115 ],
116}
117
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400118cc_library {
119 name: "libcow_operation_convert",
120 host_supported: true,
121 recovery_available: true,
122 defaults: [
123 "ue_defaults",
124 "update_metadata-protos_exports",
125 ],
126 srcs: [
127 "common/cow_operation_convert.cc",
128 ],
129 static_libs: [
130 "libsnapshot_cow",
131 "update_metadata-protos",
132 "libpayload_extent_ranges",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500133 "libpayload_extent_utils",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400134 "libbrotli",
135 "libz",
136 ],
137}
138
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700139// update_metadata-protos (type: static_library)
140// ========================================================
141// Protobufs.
142cc_defaults {
143 name: "update_metadata-protos_exports",
144
145 shared_libs: ["libprotobuf-cpp-lite"],
146}
147
148cc_library_static {
149 name: "update_metadata-protos",
150 host_supported: true,
Inseob Kim3cce62a2021-06-14 11:55:35 +0900151 ramdisk_available: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700152 recovery_available: true,
153
154 srcs: ["update_engine/update_metadata.proto"],
155 cflags: [
156 "-Wall",
157 "-Werror",
158 ],
159 proto: {
160 canonical_path_from_root: false,
161 export_proto_headers: true,
162 },
163}
164
Kelvin Zhang73202a92022-06-02 10:19:54 -0700165python_library_host {
166 name: "update_metadata-protos-python",
167 srcs: ["update_metadata.proto"],
168 proto: {
169 canonical_path_from_root: false,
170 },
171}
172
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700173// libpayload_consumer (type: static_library)
174// ========================================================
175// The payload application component and common dependencies.
176cc_defaults {
177 name: "libpayload_consumer_exports",
178 defaults: ["update_metadata-protos_exports"],
179
180 static_libs: [
181 "update_metadata-protos",
182 "libxz",
183 "libbz",
184 "libbspatch",
185 "libbrotli",
Tianjie99d570d2020-06-04 14:57:19 -0700186 "libc++fs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700187 "libfec_rs",
188 "libpuffpatch",
189 "libverity_tree",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400190 "libsnapshot_cow",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400191 "libbrotli",
192 "libz",
193 "libpayload_extent_ranges",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500194 "libpayload_extent_utils",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400195 "libcow_operation_convert",
Kelvin Zhang55624032021-12-20 12:13:24 -0800196 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800197 "liblz4patch",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700198 ],
199 shared_libs: [
200 "libbase",
201 "libcrypto",
Sen Jiangb5f631d2018-12-18 16:59:57 -0800202 "libfec",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800203 "liblz4",
Tianjie99d570d2020-06-04 14:57:19 -0700204 "libziparchive",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700205 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700206}
207
208cc_library_static {
209 name: "libpayload_consumer",
210 defaults: [
211 "ue_defaults",
212 "libpayload_consumer_exports",
213 ],
214 host_supported: true,
215 recovery_available: true,
216
217 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700218 "aosp/platform_constants_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700219 "common/action_processor.cc",
220 "common/boot_control_stub.cc",
221 "common/clock.cc",
222 "common/constants.cc",
223 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800224 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700225 "common/error_code_utils.cc",
226 "common/file_fetcher.cc",
227 "common/hash_calculator.cc",
228 "common/http_common.cc",
229 "common/http_fetcher.cc",
230 "common/hwid_override.cc",
231 "common/multi_range_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700232 "common/prefs.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700233 "common/subprocess.cc",
234 "common/terminator.cc",
235 "common/utils.cc",
236 "payload_consumer/bzip_extent_writer.cc",
237 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700238 "payload_consumer/certificate_parser_android.cc",
Kelvin Zhang569c97e2020-10-26 12:12:24 -0400239 "payload_consumer/cow_writer_file_descriptor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700240 "payload_consumer/delta_performer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700241 "payload_consumer/extent_reader.cc",
242 "payload_consumer/extent_writer.cc",
243 "payload_consumer/file_descriptor.cc",
244 "payload_consumer/file_descriptor_utils.cc",
245 "payload_consumer/file_writer.cc",
246 "payload_consumer/filesystem_verifier_action.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -0500247 "payload_consumer/install_operation_executor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700248 "payload_consumer/install_plan.cc",
249 "payload_consumer/mount_history.cc",
250 "payload_consumer/payload_constants.cc",
251 "payload_consumer/payload_metadata.cc",
252 "payload_consumer/payload_verifier.cc",
Kelvin Zhang50bac652020-09-28 15:51:41 -0400253 "payload_consumer/partition_writer.cc",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400254 "payload_consumer/partition_writer_factory_android.cc",
255 "payload_consumer/vabc_partition_writer.cc",
Kelvin Zhang4bb49202021-07-08 21:39:05 -0400256 "payload_consumer/xor_extent_writer.cc",
Kelvin Zhangb1706762021-06-25 15:05:22 -0400257 "payload_consumer/block_extent_writer.cc",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400258 "payload_consumer/snapshot_extent_writer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700259 "payload_consumer/postinstall_runner_action.cc",
Kelvin Zhangab3ce602021-02-24 14:46:40 -0500260 "payload_consumer/verified_source_fd.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700261 "payload_consumer/verity_writer_android.cc",
262 "payload_consumer/xz_extent_writer.cc",
263 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700264 "payload_consumer/partition_update_generator_android.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700265 "update_status_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700266 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700267}
268
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000269cc_library_static {
270 name: "libstatslog_ue",
271 generated_sources: ["statslog_ue.cpp"],
272 generated_headers: ["statslog_ue.h"],
273 export_generated_headers: ["statslog_ue.h"],
274 shared_libs: [
275 "libstatssocket",
276 ]
277}
278
279genrule {
280 name: "statslog_ue.h",
281 tools: ["stats-log-api-gen"],
282 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_ue.h --module update_engine --namespace chromeos_update_engine,statsd",
283 out: [
284 "statslog_ue.h",
285 ],
286}
287
288genrule {
289 name: "statslog_ue.cpp",
290 tools: ["stats-log-api-gen"],
291 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_ue.cpp --module update_engine --namespace chromeos_update_engine,statsd --importHeader statslog_ue.h",
292 out: [
293 "statslog_ue.cpp",
294 ],
295}
296
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700297// libupdate_engine_boot_control (type: static_library)
298// ========================================================
299// A BootControl class implementation using Android's HIDL boot_control HAL.
300cc_defaults {
301 name: "libupdate_engine_boot_control_exports",
302 defaults: ["update_metadata-protos_exports"],
303
Yifan Hong420db9b2019-07-23 20:50:33 -0700304 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800305 "libcutils",
306 "libfs_mgr_binder",
307 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800308 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700309 "libsnapshot",
David Anderson6c190a22020-09-21 17:09:53 -0700310 "libsnapshot_cow",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000311 "libstatslog_ue",
David Anderson6c190a22020-09-21 17:09:53 -0700312 "libz",
Yifan Hong420db9b2019-07-23 20:50:33 -0700313 "update_metadata-protos",
314 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700315 shared_libs: [
316 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700317 "libhidlbase",
318 "liblp",
319 "libutils",
320 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700321 "android.hardware.boot@1.1",
Kelvin Zhangcb419e62021-06-16 13:56:47 -0400322 "android.hardware.boot@1.2",
Kelvin Zhang8251dc02022-06-14 09:46:46 -0700323 "android.hardware.boot-V1-ndk",
Kelvin Zhange9c1d372022-06-13 15:40:44 -0700324 "libboot_control_client",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700325 ],
Yifan Hong29692902020-03-26 12:47:05 -0700326 header_libs: [
327 "avb_headers",
328 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700329 target: {
330 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800331 static_libs: [
332 "libfs_mgr",
333 "libsnapshot_nobinder",
334 ],
335 exclude_static_libs: [
336 "libfs_mgr_binder",
337 "libsnapshot",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000338 "libstatslog_ue"
Yifan Hong212d7952020-02-04 11:08:08 -0800339 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700340 },
341 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700342}
343
344cc_library_static {
345 name: "libupdate_engine_boot_control",
346 defaults: [
347 "ue_defaults",
348 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800349 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700350 ],
351 recovery_available: true,
352
353 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700354 "aosp/boot_control_android.cc",
355 "aosp/cleanup_previous_update_action.cc",
356 "aosp/dynamic_partition_control_android.cc",
357 "aosp/dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700358 ],
359}
360
361// libupdate_engine_android (type: static_library)
362// ========================================================
363// The main daemon static_library used in Android (non-Brillo). This only has a
364// loop to apply payloads provided by the upper layer via a Binder interface.
365cc_defaults {
366 name: "libupdate_engine_android_exports",
367 defaults: [
368 "ue_defaults",
369 "libpayload_consumer_exports",
370 "libupdate_engine_boot_control_exports",
371 ],
372
373 static_libs: [
Tianjie838793d2021-01-14 22:05:13 -0800374 "libavb",
375 "libavb_user",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000376 "libgkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700377 "libpayload_consumer",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000378 "libstatslog_ue",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700379 "libupdate_engine_boot_control",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000380 "libPlatformProperties",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700381 ],
382 shared_libs: [
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000383 "apex_aidl_interface-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700384 "libandroid_net",
385 "libbase",
386 "libbinder",
387 "libbinderwrapper",
388 "libbootloader_message",
389 "libbrillo-binder",
390 "libcurl",
391 "libcutils",
Jeongik Cha95f89e92021-01-26 22:33:11 +0900392 "libupdate_engine_stable-V1-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700393 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700394 "libssl",
Vova Sharaienkod62c81b2022-09-21 05:32:43 +0000395 "libstatssocket",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700396 "libutils",
397 ],
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100398 whole_static_libs: [
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000399 "libcom.android.sysprop.apex",
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100400 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700401}
402
403cc_library_static {
404 name: "libupdate_engine_android",
405 defaults: [
406 "ue_defaults",
407 "libupdate_engine_android_exports",
408 ],
409
410 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
411 // out of the DBus interface.
412 include_dirs: ["external/cros/system_api/dbus"],
413
414 aidl: {
415 local_include_dirs: ["binder_bindings"],
416 export_aidl_headers: true,
417 },
418
419 srcs: [
420 ":libupdate_engine_aidl",
Amin Hassani538bd592020-11-04 20:46:08 -0800421 "common/system_state.cc",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000422 "aosp/apex_handler_android.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700423 "aosp/binder_service_android.cc",
424 "aosp/binder_service_stable_android.cc",
425 "aosp/daemon_android.cc",
426 "aosp/daemon_state_android.cc",
427 "aosp/hardware_android.cc",
428 "aosp/logging_android.cc",
429 "aosp/network_selector_android.cc",
430 "aosp/update_attempter_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700431 "certificate_checker.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800432 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700433 "libcurl_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700434 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700435 "update_boot_flags_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700436 ],
437}
438
439// update_engine (type: executable)
440// ========================================================
441// update_engine daemon.
442cc_binary {
443 name: "update_engine",
444 defaults: [
445 "ue_defaults",
446 "libupdate_engine_android_exports",
447 ],
448
449 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700450 required: [
451 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700452 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700453 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700454
Amin Hassaniec7bc112020-10-29 16:47:58 -0700455 srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700456 init_rc: ["update_engine.rc"],
457}
458
459// update_engine_sideload (type: executable)
460// ========================================================
461// A binary executable equivalent to update_engine daemon that installs an update
462// from a local file directly instead of running in the background. Used in
463// recovery image.
464cc_binary {
465 name: "update_engine_sideload",
466 defaults: [
467 "ue_defaults",
468 "update_metadata-protos_exports",
469 "libupdate_engine_boot_control_exports",
470 "libpayload_consumer_exports",
471 ],
472 recovery: true,
473
474 cflags: ["-D_UE_SIDELOAD"],
475 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
476 // out of the DBus interface.
477 include_dirs: ["external/cros/system_api/dbus"],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -0700478 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700479
480 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700481 "aosp/hardware_android.cc",
482 "aosp/logging_android.cc",
483 "aosp/sideload_main.cc",
484 "aosp/update_attempter_android.cc",
485 "common/metrics_reporter_stub.cc",
486 "common/network_selector_stub.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800487 "common/system_state.cc",
488 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700489 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700490 "update_boot_flags_action.cc",
491 "update_status_utils.cc",
492 ],
493
494 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
495 // as it doesn't look beneficial to be installed separately due to its size. Note
496 // that we explicitly request their recovery variants, so that the expected files
497 // will be used and installed.
498 shared_libs: [
499 "libbase",
500 "liblog",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800501 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700502 ],
503 static_libs: [
504 "libpayload_consumer",
505 "libupdate_engine_boot_control",
506 "update_metadata-protos",
507
508 // We add the static versions of the shared libraries that are not installed to
509 // recovery image due to size concerns. Need to include all the static library
510 // dependencies of these static libraries.
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000511 "libgkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700512 "libevent",
513 "libmodpb64",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700514 "libprotobuf-cpp-lite",
515 "libbrillo-stream",
516 "libbrillo",
517 "libchrome",
518 ],
519 target: {
520 recovery: {
521 exclude_shared_libs: [
522 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700523 "libbrillo-stream",
524 "libbrillo",
525 "libchrome",
526 ],
527 },
528 },
529
Tao Bao1e1c86c2019-04-18 10:48:32 -0700530 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700531 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700532 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700533}
534
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700535// update_engine_client (type: executable)
536// ========================================================
537// update_engine console client.
538cc_binary {
539 name: "update_engine_client",
540 defaults: ["ue_defaults"],
541
542 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
543 // out of the DBus interface.
544 include_dirs: ["external/cros/system_api/dbus"],
545
546 shared_libs: [
547 "libbinder",
548 "libbinderwrapper",
549 "libbrillo-binder",
550 "libutils",
551 ],
552
553 aidl: {
554 local_include_dirs: ["binder_bindings"],
555 },
556
557 srcs: [
558 ":libupdate_engine_aidl",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700559 "aosp/update_engine_client_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700560 "common/error_code_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700561 "update_status_utils.cc",
562 ],
563}
564
565// libpayload_generator (type: static_library)
566// ========================================================
567// server-side code. This is used for delta_generator and unittests but not
568// for any client code.
569cc_defaults {
570 name: "libpayload_generator_exports",
571 defaults: [
572 "libpayload_consumer_exports",
573 "update_metadata-protos_exports",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800574 "erofs-utils_export_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700575 ],
576
Tianjie37ae8562020-03-25 15:16:01 -0700577 header_libs: [
578 "bootimg_headers",
579 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700580 static_libs: [
581 "libavb",
582 "libbrotli",
583 "libbsdiff",
584 "libdivsufsort",
585 "libdivsufsort64",
586 "liblzma",
587 "libpayload_consumer",
588 "libpuffdiff",
Tianjiea69cfe22021-08-22 23:28:44 -0700589 "libzucchini",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700590 "libverity_tree",
591 "update_metadata-protos",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500592 "libpayload_extent_utils",
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500593 "libcow_size_estimator",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800594 "liberofs",
Kelvin Zhang702ce4c2022-07-14 10:43:22 -0700595 "libselinux",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800596 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800597 "liblz4diff",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700598 ],
599 shared_libs: [
600 "libbase",
601 "libext2fs",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800602 // LZ4 has to be a shared lib, as we want to override it with
603 // LD_LIBRARY_PRELOAD later
604 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700605 ],
606}
607
608cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000609 name: "libpayload_extent_ranges",
610 defaults: [
611 "ue_defaults",
612 ],
613 host_supported: true,
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400614 recovery_available: true,
David Andersonc1c93052020-08-26 18:22:09 +0000615 srcs: [
616 "payload_generator/extent_ranges.cc",
617 ],
618 static_libs: [
619 "update_metadata-protos",
620 ],
621}
622
623cc_library_static {
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500624 name: "libcow_size_estimator",
625 defaults: [
626 "ue_defaults",
627 "update_metadata-protos_exports"
628 ],
629 host_supported: true,
630 recovery_available: true,
631 srcs: [
632 "payload_generator/cow_size_estimator.cc",
633 ],
634 static_libs: [
635 "update_metadata-protos",
636 "libbase",
637 "libsnapshot_cow",
638 "libcow_operation_convert",
639 ],
640}
641
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800642cc_defaults {
643 name: "liblz4diff_defaults",
644 static_libs: [
645 "lz4diff-protos",
646 "update_metadata-protos",
647 "libssl",
648 "libbsdiff",
649 "libpuffdiff",
650 ],
651 shared_libs: [
652 "liblz4",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800653 ],
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800654}
655
656cc_library_static {
657 name: "liblz4diff",
658 host_supported: true,
659 defaults: ["ue_defaults", "liblz4diff_defaults"],
660 srcs: [
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800661 "lz4diff/lz4diff.cc",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800662 "lz4diff/lz4diff_compress.cc",
663 ],
664}
665
666cc_library_static {
667 name: "liblz4patch",
668 host_supported: true,
669 recovery_available: true,
670 defaults: ["ue_defaults"],
671 static_libs: [
672 "lz4diff-protos",
673 "update_metadata-protos",
674 "libssl",
675 "libbspatch",
676 "libpuffpatch",
677 ],
678 shared_libs: [
679 "liblz4",
680 ],
681 srcs: [
682 "lz4diff/lz4patch.cc",
683 "lz4diff/lz4diff_compress.cc",
684 ],
685}
686
Kelvin Zhang35cff4f2021-12-08 16:06:00 -0800687cc_binary_host {
688 name: "lz4diff",
689 defaults: [
690 "ue_defaults",
691 "libpayload_generator_exports",
692 ],
693 static_libs: [
694 "libpayload_generator",
695 "liblz4diff",
696 "liblz4patch",
697 ],
698 srcs: [
699 "lz4diff/lz4diff_main.cc",
700 ],
701}
702
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500703cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700704 name: "libpayload_generator",
705 defaults: [
706 "ue_defaults",
707 "libpayload_generator_exports",
708 ],
709 host_supported: true,
710
711 srcs: [
Amin Hassani538bd592020-11-04 20:46:08 -0800712 "common/system_state.cc",
713 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700714 "payload_generator/ab_generator.cc",
715 "payload_generator/annotated_operation.cc",
716 "payload_generator/blob_file_writer.cc",
717 "payload_generator/block_mapping.cc",
718 "payload_generator/boot_img_filesystem.cc",
719 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700720 "payload_generator/deflate_utils.cc",
721 "payload_generator/delta_diff_generator.cc",
722 "payload_generator/delta_diff_utils.cc",
723 "payload_generator/ext2_filesystem.cc",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800724 "payload_generator/erofs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700725 "payload_generator/extent_ranges.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700726 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700727 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700728 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700729 "payload_generator/payload_file.cc",
730 "payload_generator/payload_generation_config_android.cc",
731 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700732 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700733 "payload_generator/payload_signer.cc",
734 "payload_generator/raw_filesystem.cc",
735 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700736 "payload_generator/xz_android.cc",
737 ],
738}
739
740// delta_generator (type: executable)
741// ========================================================
742// server-side delta generator.
743cc_binary_host {
744 name: "delta_generator",
745 defaults: [
746 "ue_defaults",
747 "libpayload_generator_exports",
748 "libpayload_consumer_exports",
749 ],
750
751 static_libs: [
752 "libavb_host_sysdeps",
753 "libpayload_consumer",
754 "libpayload_generator",
755 ],
756
757 srcs: ["payload_generator/generate_delta_main.cc"],
758}
759
760cc_test {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700761 host_supported: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700762 name: "ue_unittest_delta_generator",
763 defaults: [
764 "ue_defaults",
765 "libpayload_generator_exports",
766 "libpayload_consumer_exports",
767 ],
768
769 static_libs: [
770 "libpayload_consumer",
771 "libpayload_generator",
772 ],
773
774 srcs: ["payload_generator/generate_delta_main.cc"],
775
776 gtest: false,
777 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700778}
779
780// test_http_server (type: executable)
781// ========================================================
782// Test HTTP Server.
783cc_test {
784 name: "test_http_server",
785 defaults: ["ue_defaults"],
786 srcs: [
787 "common/http_common.cc",
788 "test_http_server.cc",
789 ],
790
791 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700792}
793
794// test_subprocess (type: executable)
795// ========================================================
796// Test helper subprocess program.
797cc_test {
798 name: "test_subprocess",
799 defaults: ["ue_defaults"],
800 srcs: ["test_subprocess.cc"],
801
802 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700803}
804
805// Public keys for unittests.
806// ========================================================
807genrule {
808 name: "ue_unittest_keys",
809 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700810 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700811 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
812 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700813 srcs: [
814 "unittest_key.pem",
815 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700816 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700817 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700818 ],
819 out: [
820 "unittest_key.pub.pem",
821 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700822 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700823 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700824 ],
825}
826
827// Sample images for unittests.
828// ========================================================
829// Extract sample image from the compressed sample_images.tar.bz2 file used by
830// the unittests.
831genrule {
832 name: "ue_unittest_disk_imgs",
833 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
834 srcs: ["sample_images/sample_images.tar.bz2"],
835 out: [
836 "gen/disk_ext2_1k.img",
837 "gen/disk_ext2_4k.img",
838 "gen/disk_ext2_4k_empty.img",
839 "gen/disk_ext2_unittest.img",
840 ],
841}
842
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800843genrule {
844 name: "ue_unittest_erofs_imgs",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800845 cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " +
846 "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " +
847 "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800848 srcs: ["sample_images/generate_test_erofs_images.sh"],
849 out: [
850 "gen/erofs.img",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800851 "gen/erofs_new.img",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800852 "gen/erofs_empty.img",
853 ],
854 tools: [
855 "mkfs.erofs",
856 "delta_generator",
857 ],
858}
859
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700860filegroup {
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800861 name: "update_engine_host_unittest_timeout_srcs",
862 srcs: [
863 "common/action_processor_unittest.cc",
864 "common/file_fetcher_unittest.cc",
865 "payload_generator/delta_diff_utils_unittest.cc",
866 ],
867}
868
869filegroup {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700870 name: "update_engine_host_unittest_srcs",
871 srcs: [
872 "common/action_pipe_unittest.cc",
873 "common/action_processor_unittest.cc",
874 "common/action_unittest.cc",
875 "common/cow_operation_convert_unittest.cc",
876 "common/cpu_limiter_unittest.cc",
877 "common/fake_prefs.cc",
878 "common/file_fetcher_unittest.cc",
879 "common/hash_calculator_unittest.cc",
880 "common/hwid_override_unittest.cc",
881 "common/metrics_reporter_stub.cc",
882 "common/mock_http_fetcher.cc",
883 "common/prefs_unittest.cc",
884 "common/terminator_unittest.cc",
885 "common/test_utils.cc",
Kelvin Zhang55624032021-12-20 12:13:24 -0800886 "lz4diff/lz4diff_compress_unittest.cc",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800887 "lz4diff/lz4diff_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700888 "payload_generator/ab_generator_unittest.cc",
889 "payload_generator/blob_file_writer_unittest.cc",
890 "payload_generator/block_mapping_unittest.cc",
891 "payload_generator/boot_img_filesystem_unittest.cc",
892 "payload_generator/deflate_utils_unittest.cc",
893 "payload_generator/delta_diff_utils_unittest.cc",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800894 "payload_generator/erofs_filesystem_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700895 "payload_generator/ext2_filesystem_unittest.cc",
896 "payload_generator/extent_ranges_unittest.cc",
897 "payload_generator/extent_utils_unittest.cc",
898 "payload_generator/fake_filesystem.cc",
899 "payload_generator/full_update_generator_unittest.cc",
900 "payload_generator/mapfile_filesystem_unittest.cc",
901 "payload_generator/merge_sequence_generator_unittest.cc",
902 "payload_generator/payload_file_unittest.cc",
903 "payload_generator/payload_generation_config_android_unittest.cc",
904 "payload_generator/payload_generation_config_unittest.cc",
905 "payload_generator/payload_properties_unittest.cc",
906 "payload_generator/payload_signer_unittest.cc",
907 "payload_generator/squashfs_filesystem_unittest.cc",
908 "payload_generator/zip_unittest.cc",
Kelvin Zhange4bffe62022-03-07 09:08:38 -0800909 "payload_consumer/verity_writer_android_unittest.cc",
910 "payload_consumer/xz_extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700911 "testrunner.cc",
912 ],
913}
914
915cc_test_host {
916 name: "update_engine_host_unittests",
917 defaults: [
918 "ue_defaults",
919 "libpayload_generator_exports",
920 ],
921 strip: {
922 none: true,
923 },
924 cflags: [
925 "-g3",
926 ],
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800927 tidy_timeout_srcs: [":update_engine_host_unittest_timeout_srcs"],
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700928 srcs: [":update_engine_host_unittest_srcs"],
929 data: [
930 ":ue_unittest_delta_generator",
931 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800932 ":ue_unittest_erofs_imgs",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700933 ":ue_unittest_keys",
934 "otacerts.zip",
935 "unittest_key.pem",
936 "unittest_key2.pem",
937 "unittest_key_RSA4096.pem",
938 "unittest_key_EC.pem",
939 "update_engine.conf",
940 ],
941 static_libs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700942 "libgmock",
943 "libpayload_generator",
944 ],
945}
946
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700947// update_engine_unittests (type: executable)
948// ========================================================
949// Main unittest file.
950cc_test {
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700951 name: "update_engine_http_unittests",
952 defaults: [
953 "ue_defaults",
954 "liblz4diff_defaults",
955 "update_metadata-protos_exports",
956 ],
957 require_root: true,
958 static_libs: [
959 "libbase",
960 "libbrillo-test-helpers",
961 "libchrome_test_helpers",
962 "libcurl",
963 "libcutils",
964 "libdm",
965 "libgmock",
966 "libz",
967 ],
968 shared_libs: [
969 "libssl",
970 "libcrypto",
971 "libziparchive",
972 "liblog",
973 ],
974
975 data: [
976 ":test_http_server",
977 ":test_subprocess",
978 ":ue_unittest_keys",
979 "otacerts.zip",
980 "unittest_key.pem",
981 "unittest_key2.pem",
982 "unittest_key_RSA4096.pem",
983 "unittest_key_EC.pem",
984 ],
985
986 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
987 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
988 // test_config: "test_config.xml",
989 test_suites: ["device-tests"],
990
991 srcs: [
992 "aosp/platform_constants_android.cc",
993 "certificate_checker.cc",
994 "common/action_processor.cc",
995 "common/boot_control_stub.cc",
996 "common/error_code_utils.cc",
997 "common/file_fetcher.cc",
998 "common/hash_calculator.cc",
999 "common/http_fetcher.cc",
1000 "common/multi_range_http_fetcher.cc",
1001 "common/http_common.cc",
1002 "common/subprocess.cc",
1003 "common/test_utils.cc",
1004 "common/utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001005 "libcurl_http_fetcher.cc",
1006 "payload_consumer/certificate_parser_android.cc",
1007 "payload_consumer/payload_verifier.cc",
1008 "payload_generator/payload_signer.cc",
1009 "update_status_utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001010 "certificate_checker_unittest.cc",
1011 "common/http_fetcher_unittest.cc",
1012 "common/mock_http_fetcher.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -07001013 "common/subprocess_unittest.cc",
1014 "libcurl_http_fetcher_unittest.cc",
1015 "payload_consumer/certificate_parser_android_unittest.cc",
1016 "update_status_utils_unittest.cc",
1017 ],
1018}
1019
1020// update_engine_unittests (type: executable)
1021// ========================================================
1022// Main unittest file.
1023cc_test {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001024 name: "update_engine_unittests",
1025 defaults: [
1026 "ue_defaults",
1027 "libpayload_generator_exports",
1028 "libupdate_engine_android_exports",
1029 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001030
1031 static_libs: [
1032 "libpayload_generator",
1033 "libbrillo-test-helpers",
1034 "libgmock",
1035 "libchrome_test_helpers",
1036 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -08001037 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001038 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001039
Yifan Hong87ea73f2019-09-12 13:07:37 -07001040 header_libs: [
1041 "libstorage_literals_headers",
1042 ],
1043
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001044 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -07001045 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001046 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001047 ":ue_unittest_erofs_imgs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001048 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -07001049 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001050 "unittest_key.pem",
1051 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -07001052 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -07001053 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001054 "update_engine.conf",
1055 ],
1056
Tao Bao9456b6f2019-04-29 18:14:58 -07001057 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1058 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1059 test_config: "test_config.xml",
1060 test_suites: ["device-tests"],
1061
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001062 tidy_timeout_srcs: [
1063 ":update_engine_host_unittest_timeout_srcs",
1064 "aosp/dynamic_partition_control_android_unittest.cc",
1065 "common/http_fetcher_unittest.cc",
1066 "payload_consumer/delta_performer_integration_test.cc",
1067 "payload_consumer/delta_performer_unittest.cc",
1068 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001069 srcs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001070 ":update_engine_host_unittest_srcs",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +00001071 "aosp/apex_handler_android_unittest.cc",
Kelvin Zhangb4b95c22021-04-05 15:56:26 -04001072 "aosp/cleanup_previous_update_action_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001073 "aosp/dynamic_partition_control_android_unittest.cc",
Kelvin Zhang3fe49642021-10-04 15:35:02 -07001074 "aosp/update_attempter_android_integration_test.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001075 "aosp/update_attempter_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001076 "common/utils_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001077 "download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001078 "payload_consumer/bzip_extent_writer_unittest.cc",
1079 "payload_consumer/cached_file_descriptor_unittest.cc",
Kelvin Zhang46d6c492021-04-26 17:51:25 -04001080 "payload_consumer/cow_writer_file_descriptor_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001081 "payload_consumer/delta_performer_integration_test.cc",
1082 "payload_consumer/delta_performer_unittest.cc",
1083 "payload_consumer/extent_reader_unittest.cc",
1084 "payload_consumer/extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001085 "payload_consumer/extent_map_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001086 "payload_consumer/fake_file_descriptor.cc",
1087 "payload_consumer/file_descriptor_utils_unittest.cc",
1088 "payload_consumer/file_writer_unittest.cc",
1089 "payload_consumer/filesystem_verifier_action_unittest.cc",
Amin Hassani23795032020-11-24 14:38:55 -08001090 "payload_consumer/install_plan_unittest.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -05001091 "payload_consumer/install_operation_executor_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -07001092 "payload_consumer/partition_update_generator_android_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001093 "payload_consumer/partition_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001094 "payload_consumer/postinstall_runner_action_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001095 "payload_consumer/snapshot_extent_writer_unittest.cc",
1096 "payload_consumer/vabc_partition_writer_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001097 "payload_consumer/xor_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001098 ],
1099}
1100
1101// Brillo update payload generation script
1102// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001103sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001104 name: "brillo_update_payload",
1105 device_supported: false,
1106 host_supported: true,
1107
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001108 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001109 required: [
1110 "delta_generator",
1111 "shflags",
1112 "simg2img",
1113 ],
1114
1115 target: {
1116 darwin: {
1117 enabled: false,
1118 },
1119 },
Colin Cross606913a2017-11-14 13:05:37 -08001120}
Yifan Hongd51738c2020-07-23 17:06:25 -07001121
1122// update_engine header library
1123cc_library_headers {
1124 name: "libupdate_engine_headers",
Yifan Hong309c8a82020-10-06 18:31:08 -07001125
1126 // This header library is available to core and product modules.
Justin Yun6d121de2020-11-11 19:31:57 +09001127 product_available: true,
Yifan Hong309c8a82020-10-06 18:31:08 -07001128
Yifan Hongd51738c2020-07-23 17:06:25 -07001129 export_include_dirs: ["."],
1130 apex_available: [
1131 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -07001132 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -07001133 ],
David Andersonc1c93052020-08-26 18:22:09 +00001134 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001135 recovery_available: true,
1136 ramdisk_available: true,
1137
1138 target: {
1139 darwin: {
1140 enabled: false,
1141 },
1142 }
Yifan Hongd51738c2020-07-23 17:06:25 -07001143}
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001144
1145cc_binary_host {
1146 name: "cow_converter",
1147 defaults: [
1148 "ue_defaults",
1149 "libpayload_consumer_exports",
1150 ],
1151 srcs: [
1152 "aosp/cow_converter.cc",
1153 ],
1154 static_libs: [
1155 "liblog",
1156 "libbrotli",
1157 "libbase",
1158 "libcow_operation_convert",
1159 "libcow_size_estimator",
Kelvin Zhang901c7d52022-06-21 09:35:45 -07001160 "libgflags",
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001161 "libpayload_consumer",
1162 "libpayload_extent_ranges",
1163 "libpayload_extent_utils",
1164 "libsnapshot_cow",
1165 "libz",
1166 "update_metadata-protos",
1167 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -07001168}
Kelvin Zhang98001b22021-12-08 14:10:11 -08001169
1170cc_library_static {
1171 name: "lz4diff-protos",
1172 host_supported: true,
1173 ramdisk_available: true,
1174 recovery_available: true,
1175
1176 srcs: ["lz4diff/lz4diff.proto"],
1177 cflags: [
1178 "-Wall",
1179 "-Werror",
1180 ],
1181 proto: {
1182 canonical_path_from_root: false,
1183 export_proto_headers: true,
1184 },
1185}
Kelvin Zhang596a3202022-03-07 14:13:42 -08001186
1187cc_binary_host {
1188 name: "ota_extractor",
1189 defaults: [
1190 "ue_defaults",
1191 "libpayload_consumer_exports",
1192 ],
1193 srcs: [
1194 "aosp/ota_extractor.cc",
1195 ],
1196 static_libs: [
1197 "liblog",
1198 "libbrotli",
1199 "libbase",
1200 "libpayload_consumer",
1201 "libpayload_extent_ranges",
1202 "libpayload_extent_utils",
1203 "libz",
1204 "libgflags",
1205 "update_metadata-protos",
1206 ],
1207}