blob: 92959855869ede57d0dafe15de9fa502411107ba [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
269// libupdate_engine_boot_control (type: static_library)
270// ========================================================
271// A BootControl class implementation using Android's HIDL boot_control HAL.
272cc_defaults {
273 name: "libupdate_engine_boot_control_exports",
274 defaults: ["update_metadata-protos_exports"],
275
Yifan Hong420db9b2019-07-23 20:50:33 -0700276 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800277 "libcutils",
278 "libfs_mgr_binder",
279 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800280 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700281 "libsnapshot",
David Anderson6c190a22020-09-21 17:09:53 -0700282 "libsnapshot_cow",
283 "libz",
Yifan Hong420db9b2019-07-23 20:50:33 -0700284 "update_metadata-protos",
285 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700286 shared_libs: [
287 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700288 "libhidlbase",
289 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800290 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700291 "libutils",
292 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700293 "android.hardware.boot@1.1",
Kelvin Zhangcb419e62021-06-16 13:56:47 -0400294 "android.hardware.boot@1.2",
Kelvin Zhang8251dc02022-06-14 09:46:46 -0700295 "android.hardware.boot-V1-ndk",
Kelvin Zhange9c1d372022-06-13 15:40:44 -0700296 "libboot_control_client",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700297 ],
Yifan Hong29692902020-03-26 12:47:05 -0700298 header_libs: [
299 "avb_headers",
300 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700301 target: {
302 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800303 static_libs: [
304 "libfs_mgr",
305 "libsnapshot_nobinder",
306 ],
307 exclude_static_libs: [
308 "libfs_mgr_binder",
309 "libsnapshot",
310 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800311 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800312 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800313 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700314 },
315 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700316}
317
318cc_library_static {
319 name: "libupdate_engine_boot_control",
320 defaults: [
321 "ue_defaults",
322 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800323 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700324 ],
325 recovery_available: true,
326
327 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700328 "aosp/boot_control_android.cc",
329 "aosp/cleanup_previous_update_action.cc",
330 "aosp/dynamic_partition_control_android.cc",
331 "aosp/dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700332 ],
333}
334
335// libupdate_engine_android (type: static_library)
336// ========================================================
337// The main daemon static_library used in Android (non-Brillo). This only has a
338// loop to apply payloads provided by the upper layer via a Binder interface.
339cc_defaults {
340 name: "libupdate_engine_android_exports",
341 defaults: [
342 "ue_defaults",
343 "libpayload_consumer_exports",
344 "libupdate_engine_boot_control_exports",
345 ],
346
347 static_libs: [
Tianjie838793d2021-01-14 22:05:13 -0800348 "libavb",
349 "libavb_user",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000350 "libgkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700351 "libpayload_consumer",
352 "libupdate_engine_boot_control",
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000353 "libPlatformProperties",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700354 ],
355 shared_libs: [
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000356 "apex_aidl_interface-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700357 "libandroid_net",
358 "libbase",
359 "libbinder",
360 "libbinderwrapper",
361 "libbootloader_message",
362 "libbrillo-binder",
363 "libcurl",
364 "libcutils",
Jeongik Cha95f89e92021-01-26 22:33:11 +0900365 "libupdate_engine_stable-V1-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700366 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700367 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700368 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700369 "libutils",
370 ],
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100371 whole_static_libs: [
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000372 "libcom.android.sysprop.apex",
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100373 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700374}
375
376cc_library_static {
377 name: "libupdate_engine_android",
378 defaults: [
379 "ue_defaults",
380 "libupdate_engine_android_exports",
381 ],
382
383 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
384 // out of the DBus interface.
385 include_dirs: ["external/cros/system_api/dbus"],
386
387 aidl: {
388 local_include_dirs: ["binder_bindings"],
389 export_aidl_headers: true,
390 },
391
392 srcs: [
393 ":libupdate_engine_aidl",
Amin Hassani538bd592020-11-04 20:46:08 -0800394 "common/system_state.cc",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000395 "aosp/apex_handler_android.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700396 "aosp/binder_service_android.cc",
397 "aosp/binder_service_stable_android.cc",
398 "aosp/daemon_android.cc",
399 "aosp/daemon_state_android.cc",
400 "aosp/hardware_android.cc",
401 "aosp/logging_android.cc",
402 "aosp/network_selector_android.cc",
403 "aosp/update_attempter_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700404 "certificate_checker.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800405 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700406 "libcurl_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700407 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700408 "update_boot_flags_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700409 ],
410}
411
412// update_engine (type: executable)
413// ========================================================
414// update_engine daemon.
415cc_binary {
416 name: "update_engine",
417 defaults: [
418 "ue_defaults",
419 "libupdate_engine_android_exports",
420 ],
421
422 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700423 required: [
424 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700425 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700426 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700427
Amin Hassaniec7bc112020-10-29 16:47:58 -0700428 srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700429 init_rc: ["update_engine.rc"],
430}
431
432// update_engine_sideload (type: executable)
433// ========================================================
434// A binary executable equivalent to update_engine daemon that installs an update
435// from a local file directly instead of running in the background. Used in
436// recovery image.
437cc_binary {
438 name: "update_engine_sideload",
439 defaults: [
440 "ue_defaults",
441 "update_metadata-protos_exports",
442 "libupdate_engine_boot_control_exports",
443 "libpayload_consumer_exports",
444 ],
445 recovery: true,
446
447 cflags: ["-D_UE_SIDELOAD"],
448 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
449 // out of the DBus interface.
450 include_dirs: ["external/cros/system_api/dbus"],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -0700451 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700452
453 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700454 "aosp/hardware_android.cc",
455 "aosp/logging_android.cc",
456 "aosp/sideload_main.cc",
457 "aosp/update_attempter_android.cc",
458 "common/metrics_reporter_stub.cc",
459 "common/network_selector_stub.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800460 "common/system_state.cc",
461 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700462 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700463 "update_boot_flags_action.cc",
464 "update_status_utils.cc",
465 ],
466
467 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
468 // as it doesn't look beneficial to be installed separately due to its size. Note
469 // that we explicitly request their recovery variants, so that the expected files
470 // will be used and installed.
471 shared_libs: [
472 "libbase",
473 "liblog",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800474 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700475 ],
476 static_libs: [
477 "libpayload_consumer",
478 "libupdate_engine_boot_control",
479 "update_metadata-protos",
480
481 // We add the static versions of the shared libraries that are not installed to
482 // recovery image due to size concerns. Need to include all the static library
483 // dependencies of these static libraries.
Trevor Radcliffee877eac2022-06-08 14:10:21 +0000484 "libgkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700485 "libevent",
486 "libmodpb64",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700487 "libprotobuf-cpp-lite",
488 "libbrillo-stream",
489 "libbrillo",
490 "libchrome",
491 ],
492 target: {
493 recovery: {
494 exclude_shared_libs: [
495 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700496 "libbrillo-stream",
497 "libbrillo",
498 "libchrome",
499 ],
500 },
501 },
502
Tao Bao1e1c86c2019-04-18 10:48:32 -0700503 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700504 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700505 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700506}
507
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700508// update_engine_client (type: executable)
509// ========================================================
510// update_engine console client.
511cc_binary {
512 name: "update_engine_client",
513 defaults: ["ue_defaults"],
514
515 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
516 // out of the DBus interface.
517 include_dirs: ["external/cros/system_api/dbus"],
518
519 shared_libs: [
520 "libbinder",
521 "libbinderwrapper",
522 "libbrillo-binder",
523 "libutils",
524 ],
525
526 aidl: {
527 local_include_dirs: ["binder_bindings"],
528 },
529
530 srcs: [
531 ":libupdate_engine_aidl",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700532 "aosp/update_engine_client_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700533 "common/error_code_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700534 "update_status_utils.cc",
535 ],
536}
537
538// libpayload_generator (type: static_library)
539// ========================================================
540// server-side code. This is used for delta_generator and unittests but not
541// for any client code.
542cc_defaults {
543 name: "libpayload_generator_exports",
544 defaults: [
545 "libpayload_consumer_exports",
546 "update_metadata-protos_exports",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800547 "erofs-utils_export_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700548 ],
549
Tianjie37ae8562020-03-25 15:16:01 -0700550 header_libs: [
551 "bootimg_headers",
552 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700553 static_libs: [
554 "libavb",
555 "libbrotli",
556 "libbsdiff",
557 "libdivsufsort",
558 "libdivsufsort64",
559 "liblzma",
560 "libpayload_consumer",
561 "libpuffdiff",
Tianjiea69cfe22021-08-22 23:28:44 -0700562 "libzucchini",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700563 "libverity_tree",
564 "update_metadata-protos",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500565 "libpayload_extent_utils",
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500566 "libcow_size_estimator",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800567 "liberofs",
Kelvin Zhang702ce4c2022-07-14 10:43:22 -0700568 "libselinux",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800569 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800570 "liblz4diff",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700571 ],
572 shared_libs: [
573 "libbase",
574 "libext2fs",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800575 // LZ4 has to be a shared lib, as we want to override it with
576 // LD_LIBRARY_PRELOAD later
577 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700578 ],
579}
580
581cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000582 name: "libpayload_extent_ranges",
583 defaults: [
584 "ue_defaults",
585 ],
586 host_supported: true,
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400587 recovery_available: true,
David Andersonc1c93052020-08-26 18:22:09 +0000588 srcs: [
589 "payload_generator/extent_ranges.cc",
590 ],
591 static_libs: [
592 "update_metadata-protos",
593 ],
594}
595
596cc_library_static {
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500597 name: "libcow_size_estimator",
598 defaults: [
599 "ue_defaults",
600 "update_metadata-protos_exports"
601 ],
602 host_supported: true,
603 recovery_available: true,
604 srcs: [
605 "payload_generator/cow_size_estimator.cc",
606 ],
607 static_libs: [
608 "update_metadata-protos",
609 "libbase",
610 "libsnapshot_cow",
611 "libcow_operation_convert",
612 ],
613}
614
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800615cc_defaults {
616 name: "liblz4diff_defaults",
617 static_libs: [
618 "lz4diff-protos",
619 "update_metadata-protos",
620 "libssl",
621 "libbsdiff",
622 "libpuffdiff",
623 ],
624 shared_libs: [
625 "liblz4",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800626 ],
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800627}
628
629cc_library_static {
630 name: "liblz4diff",
631 host_supported: true,
632 defaults: ["ue_defaults", "liblz4diff_defaults"],
633 srcs: [
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800634 "lz4diff/lz4diff.cc",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800635 "lz4diff/lz4diff_compress.cc",
636 ],
637}
638
639cc_library_static {
640 name: "liblz4patch",
641 host_supported: true,
642 recovery_available: true,
643 defaults: ["ue_defaults"],
644 static_libs: [
645 "lz4diff-protos",
646 "update_metadata-protos",
647 "libssl",
648 "libbspatch",
649 "libpuffpatch",
650 ],
651 shared_libs: [
652 "liblz4",
653 ],
654 srcs: [
655 "lz4diff/lz4patch.cc",
656 "lz4diff/lz4diff_compress.cc",
657 ],
658}
659
Kelvin Zhang35cff4f2021-12-08 16:06:00 -0800660cc_binary_host {
661 name: "lz4diff",
662 defaults: [
663 "ue_defaults",
664 "libpayload_generator_exports",
665 ],
666 static_libs: [
667 "libpayload_generator",
668 "liblz4diff",
669 "liblz4patch",
670 ],
671 srcs: [
672 "lz4diff/lz4diff_main.cc",
673 ],
674}
675
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500676cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700677 name: "libpayload_generator",
678 defaults: [
679 "ue_defaults",
680 "libpayload_generator_exports",
681 ],
682 host_supported: true,
683
684 srcs: [
Amin Hassani538bd592020-11-04 20:46:08 -0800685 "common/system_state.cc",
686 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700687 "payload_generator/ab_generator.cc",
688 "payload_generator/annotated_operation.cc",
689 "payload_generator/blob_file_writer.cc",
690 "payload_generator/block_mapping.cc",
691 "payload_generator/boot_img_filesystem.cc",
692 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700693 "payload_generator/deflate_utils.cc",
694 "payload_generator/delta_diff_generator.cc",
695 "payload_generator/delta_diff_utils.cc",
696 "payload_generator/ext2_filesystem.cc",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800697 "payload_generator/erofs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700698 "payload_generator/extent_ranges.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700699 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700700 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700701 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700702 "payload_generator/payload_file.cc",
703 "payload_generator/payload_generation_config_android.cc",
704 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700705 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700706 "payload_generator/payload_signer.cc",
707 "payload_generator/raw_filesystem.cc",
708 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700709 "payload_generator/xz_android.cc",
710 ],
711}
712
713// delta_generator (type: executable)
714// ========================================================
715// server-side delta generator.
716cc_binary_host {
717 name: "delta_generator",
718 defaults: [
719 "ue_defaults",
720 "libpayload_generator_exports",
721 "libpayload_consumer_exports",
722 ],
723
724 static_libs: [
725 "libavb_host_sysdeps",
726 "libpayload_consumer",
727 "libpayload_generator",
728 ],
729
730 srcs: ["payload_generator/generate_delta_main.cc"],
731}
732
733cc_test {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700734 host_supported: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700735 name: "ue_unittest_delta_generator",
736 defaults: [
737 "ue_defaults",
738 "libpayload_generator_exports",
739 "libpayload_consumer_exports",
740 ],
741
742 static_libs: [
743 "libpayload_consumer",
744 "libpayload_generator",
745 ],
746
747 srcs: ["payload_generator/generate_delta_main.cc"],
748
749 gtest: false,
750 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700751}
752
753// test_http_server (type: executable)
754// ========================================================
755// Test HTTP Server.
756cc_test {
757 name: "test_http_server",
758 defaults: ["ue_defaults"],
759 srcs: [
760 "common/http_common.cc",
761 "test_http_server.cc",
762 ],
763
764 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700765}
766
767// test_subprocess (type: executable)
768// ========================================================
769// Test helper subprocess program.
770cc_test {
771 name: "test_subprocess",
772 defaults: ["ue_defaults"],
773 srcs: ["test_subprocess.cc"],
774
775 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700776}
777
778// Public keys for unittests.
779// ========================================================
780genrule {
781 name: "ue_unittest_keys",
782 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700783 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700784 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
785 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700786 srcs: [
787 "unittest_key.pem",
788 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700789 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700790 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700791 ],
792 out: [
793 "unittest_key.pub.pem",
794 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700795 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700796 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700797 ],
798}
799
800// Sample images for unittests.
801// ========================================================
802// Extract sample image from the compressed sample_images.tar.bz2 file used by
803// the unittests.
804genrule {
805 name: "ue_unittest_disk_imgs",
806 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
807 srcs: ["sample_images/sample_images.tar.bz2"],
808 out: [
809 "gen/disk_ext2_1k.img",
810 "gen/disk_ext2_4k.img",
811 "gen/disk_ext2_4k_empty.img",
812 "gen/disk_ext2_unittest.img",
813 ],
814}
815
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800816genrule {
817 name: "ue_unittest_erofs_imgs",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800818 cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " +
819 "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " +
820 "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800821 srcs: ["sample_images/generate_test_erofs_images.sh"],
822 out: [
823 "gen/erofs.img",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800824 "gen/erofs_new.img",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800825 "gen/erofs_empty.img",
826 ],
827 tools: [
828 "mkfs.erofs",
829 "delta_generator",
830 ],
831}
832
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700833filegroup {
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800834 name: "update_engine_host_unittest_timeout_srcs",
835 srcs: [
836 "common/action_processor_unittest.cc",
837 "common/file_fetcher_unittest.cc",
838 "payload_generator/delta_diff_utils_unittest.cc",
839 ],
840}
841
842filegroup {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700843 name: "update_engine_host_unittest_srcs",
844 srcs: [
845 "common/action_pipe_unittest.cc",
846 "common/action_processor_unittest.cc",
847 "common/action_unittest.cc",
848 "common/cow_operation_convert_unittest.cc",
849 "common/cpu_limiter_unittest.cc",
850 "common/fake_prefs.cc",
851 "common/file_fetcher_unittest.cc",
852 "common/hash_calculator_unittest.cc",
853 "common/hwid_override_unittest.cc",
854 "common/metrics_reporter_stub.cc",
855 "common/mock_http_fetcher.cc",
856 "common/prefs_unittest.cc",
857 "common/terminator_unittest.cc",
858 "common/test_utils.cc",
Kelvin Zhang55624032021-12-20 12:13:24 -0800859 "lz4diff/lz4diff_compress_unittest.cc",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800860 "lz4diff/lz4diff_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700861 "payload_generator/ab_generator_unittest.cc",
862 "payload_generator/blob_file_writer_unittest.cc",
863 "payload_generator/block_mapping_unittest.cc",
864 "payload_generator/boot_img_filesystem_unittest.cc",
865 "payload_generator/deflate_utils_unittest.cc",
866 "payload_generator/delta_diff_utils_unittest.cc",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800867 "payload_generator/erofs_filesystem_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700868 "payload_generator/ext2_filesystem_unittest.cc",
869 "payload_generator/extent_ranges_unittest.cc",
870 "payload_generator/extent_utils_unittest.cc",
871 "payload_generator/fake_filesystem.cc",
872 "payload_generator/full_update_generator_unittest.cc",
873 "payload_generator/mapfile_filesystem_unittest.cc",
874 "payload_generator/merge_sequence_generator_unittest.cc",
875 "payload_generator/payload_file_unittest.cc",
876 "payload_generator/payload_generation_config_android_unittest.cc",
877 "payload_generator/payload_generation_config_unittest.cc",
878 "payload_generator/payload_properties_unittest.cc",
879 "payload_generator/payload_signer_unittest.cc",
880 "payload_generator/squashfs_filesystem_unittest.cc",
881 "payload_generator/zip_unittest.cc",
Kelvin Zhange4bffe62022-03-07 09:08:38 -0800882 "payload_consumer/verity_writer_android_unittest.cc",
883 "payload_consumer/xz_extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700884 "testrunner.cc",
885 ],
886}
887
888cc_test_host {
889 name: "update_engine_host_unittests",
890 defaults: [
891 "ue_defaults",
892 "libpayload_generator_exports",
893 ],
894 strip: {
895 none: true,
896 },
897 cflags: [
898 "-g3",
899 ],
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800900 tidy_timeout_srcs: [":update_engine_host_unittest_timeout_srcs"],
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700901 srcs: [":update_engine_host_unittest_srcs"],
902 data: [
903 ":ue_unittest_delta_generator",
904 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800905 ":ue_unittest_erofs_imgs",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700906 ":ue_unittest_keys",
907 "otacerts.zip",
908 "unittest_key.pem",
909 "unittest_key2.pem",
910 "unittest_key_RSA4096.pem",
911 "unittest_key_EC.pem",
912 "update_engine.conf",
913 ],
914 static_libs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700915 "libgmock",
916 "libpayload_generator",
917 ],
918}
919
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700920// update_engine_unittests (type: executable)
921// ========================================================
922// Main unittest file.
923cc_test {
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700924 name: "update_engine_http_unittests",
925 defaults: [
926 "ue_defaults",
927 "liblz4diff_defaults",
928 "update_metadata-protos_exports",
929 ],
930 require_root: true,
931 static_libs: [
932 "libbase",
933 "libbrillo-test-helpers",
934 "libchrome_test_helpers",
935 "libcurl",
936 "libcutils",
937 "libdm",
938 "libgmock",
939 "libz",
940 ],
941 shared_libs: [
942 "libssl",
943 "libcrypto",
944 "libziparchive",
945 "liblog",
946 ],
947
948 data: [
949 ":test_http_server",
950 ":test_subprocess",
951 ":ue_unittest_keys",
952 "otacerts.zip",
953 "unittest_key.pem",
954 "unittest_key2.pem",
955 "unittest_key_RSA4096.pem",
956 "unittest_key_EC.pem",
957 ],
958
959 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
960 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
961 // test_config: "test_config.xml",
962 test_suites: ["device-tests"],
963
964 srcs: [
965 "aosp/platform_constants_android.cc",
966 "certificate_checker.cc",
967 "common/action_processor.cc",
968 "common/boot_control_stub.cc",
969 "common/error_code_utils.cc",
970 "common/file_fetcher.cc",
971 "common/hash_calculator.cc",
972 "common/http_fetcher.cc",
973 "common/multi_range_http_fetcher.cc",
974 "common/http_common.cc",
975 "common/subprocess.cc",
976 "common/test_utils.cc",
977 "common/utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700978 "libcurl_http_fetcher.cc",
979 "payload_consumer/certificate_parser_android.cc",
980 "payload_consumer/payload_verifier.cc",
981 "payload_generator/payload_signer.cc",
982 "update_status_utils.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700983 "certificate_checker_unittest.cc",
984 "common/http_fetcher_unittest.cc",
985 "common/mock_http_fetcher.cc",
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700986 "common/subprocess_unittest.cc",
987 "libcurl_http_fetcher_unittest.cc",
988 "payload_consumer/certificate_parser_android_unittest.cc",
989 "update_status_utils_unittest.cc",
990 ],
991}
992
993// update_engine_unittests (type: executable)
994// ========================================================
995// Main unittest file.
996cc_test {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700997 name: "update_engine_unittests",
998 defaults: [
999 "ue_defaults",
1000 "libpayload_generator_exports",
1001 "libupdate_engine_android_exports",
1002 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001003
1004 static_libs: [
1005 "libpayload_generator",
1006 "libbrillo-test-helpers",
1007 "libgmock",
1008 "libchrome_test_helpers",
1009 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -08001010 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001011 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001012
Yifan Hong87ea73f2019-09-12 13:07:37 -07001013 header_libs: [
1014 "libstorage_literals_headers",
1015 ],
1016
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001017 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -07001018 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001019 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001020 ":ue_unittest_erofs_imgs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001021 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -07001022 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001023 "unittest_key.pem",
1024 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -07001025 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -07001026 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001027 "update_engine.conf",
1028 ],
1029
Tao Bao9456b6f2019-04-29 18:14:58 -07001030 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1031 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1032 test_config: "test_config.xml",
1033 test_suites: ["device-tests"],
1034
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001035 tidy_timeout_srcs: [
1036 ":update_engine_host_unittest_timeout_srcs",
1037 "aosp/dynamic_partition_control_android_unittest.cc",
1038 "common/http_fetcher_unittest.cc",
1039 "payload_consumer/delta_performer_integration_test.cc",
1040 "payload_consumer/delta_performer_unittest.cc",
1041 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001042 srcs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001043 ":update_engine_host_unittest_srcs",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +00001044 "aosp/apex_handler_android_unittest.cc",
Kelvin Zhangb4b95c22021-04-05 15:56:26 -04001045 "aosp/cleanup_previous_update_action_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001046 "aosp/dynamic_partition_control_android_unittest.cc",
Kelvin Zhang3fe49642021-10-04 15:35:02 -07001047 "aosp/update_attempter_android_integration_test.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001048 "aosp/update_attempter_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001049 "common/utils_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001050 "download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001051 "payload_consumer/bzip_extent_writer_unittest.cc",
1052 "payload_consumer/cached_file_descriptor_unittest.cc",
Kelvin Zhang46d6c492021-04-26 17:51:25 -04001053 "payload_consumer/cow_writer_file_descriptor_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001054 "payload_consumer/delta_performer_integration_test.cc",
1055 "payload_consumer/delta_performer_unittest.cc",
1056 "payload_consumer/extent_reader_unittest.cc",
1057 "payload_consumer/extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001058 "payload_consumer/extent_map_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001059 "payload_consumer/fake_file_descriptor.cc",
1060 "payload_consumer/file_descriptor_utils_unittest.cc",
1061 "payload_consumer/file_writer_unittest.cc",
1062 "payload_consumer/filesystem_verifier_action_unittest.cc",
Amin Hassani23795032020-11-24 14:38:55 -08001063 "payload_consumer/install_plan_unittest.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -05001064 "payload_consumer/install_operation_executor_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -07001065 "payload_consumer/partition_update_generator_android_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001066 "payload_consumer/partition_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001067 "payload_consumer/postinstall_runner_action_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001068 "payload_consumer/snapshot_extent_writer_unittest.cc",
1069 "payload_consumer/vabc_partition_writer_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001070 "payload_consumer/xor_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001071 ],
1072}
1073
1074// Brillo update payload generation script
1075// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001076sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001077 name: "brillo_update_payload",
1078 device_supported: false,
1079 host_supported: true,
1080
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001081 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001082 required: [
1083 "delta_generator",
1084 "shflags",
1085 "simg2img",
1086 ],
1087
1088 target: {
1089 darwin: {
1090 enabled: false,
1091 },
1092 },
Colin Cross606913a2017-11-14 13:05:37 -08001093}
Yifan Hongd51738c2020-07-23 17:06:25 -07001094
1095// update_engine header library
1096cc_library_headers {
1097 name: "libupdate_engine_headers",
Yifan Hong309c8a82020-10-06 18:31:08 -07001098
1099 // This header library is available to core and product modules.
Justin Yun6d121de2020-11-11 19:31:57 +09001100 product_available: true,
Yifan Hong309c8a82020-10-06 18:31:08 -07001101
Yifan Hongd51738c2020-07-23 17:06:25 -07001102 export_include_dirs: ["."],
1103 apex_available: [
1104 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -07001105 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -07001106 ],
David Andersonc1c93052020-08-26 18:22:09 +00001107 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001108 recovery_available: true,
1109 ramdisk_available: true,
1110
1111 target: {
1112 darwin: {
1113 enabled: false,
1114 },
1115 }
Yifan Hongd51738c2020-07-23 17:06:25 -07001116}
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001117
1118cc_binary_host {
1119 name: "cow_converter",
1120 defaults: [
1121 "ue_defaults",
1122 "libpayload_consumer_exports",
1123 ],
1124 srcs: [
1125 "aosp/cow_converter.cc",
1126 ],
1127 static_libs: [
1128 "liblog",
1129 "libbrotli",
1130 "libbase",
1131 "libcow_operation_convert",
1132 "libcow_size_estimator",
Kelvin Zhang901c7d52022-06-21 09:35:45 -07001133 "libgflags",
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001134 "libpayload_consumer",
1135 "libpayload_extent_ranges",
1136 "libpayload_extent_utils",
1137 "libsnapshot_cow",
1138 "libz",
1139 "update_metadata-protos",
1140 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -07001141}
Kelvin Zhang98001b22021-12-08 14:10:11 -08001142
1143cc_library_static {
1144 name: "lz4diff-protos",
1145 host_supported: true,
1146 ramdisk_available: true,
1147 recovery_available: true,
1148
1149 srcs: ["lz4diff/lz4diff.proto"],
1150 cflags: [
1151 "-Wall",
1152 "-Werror",
1153 ],
1154 proto: {
1155 canonical_path_from_root: false,
1156 export_proto_headers: true,
1157 },
1158}
Kelvin Zhang596a3202022-03-07 14:13:42 -08001159
1160cc_binary_host {
1161 name: "ota_extractor",
1162 defaults: [
1163 "ue_defaults",
1164 "libpayload_consumer_exports",
1165 ],
1166 srcs: [
1167 "aosp/ota_extractor.cc",
1168 ],
1169 static_libs: [
1170 "liblog",
1171 "libbrotli",
1172 "libbase",
1173 "libpayload_consumer",
1174 "libpayload_extent_ranges",
1175 "libpayload_extent_utils",
1176 "libz",
1177 "libgflags",
1178 "update_metadata-protos",
1179 ],
1180}