blob: 72b9f738707fbc749ccdbc9112436a2b4d7d5864 [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
165// libpayload_consumer (type: static_library)
166// ========================================================
167// The payload application component and common dependencies.
168cc_defaults {
169 name: "libpayload_consumer_exports",
170 defaults: ["update_metadata-protos_exports"],
171
172 static_libs: [
173 "update_metadata-protos",
174 "libxz",
175 "libbz",
176 "libbspatch",
177 "libbrotli",
Tianjie99d570d2020-06-04 14:57:19 -0700178 "libc++fs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700179 "libfec_rs",
180 "libpuffpatch",
181 "libverity_tree",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400182 "libsnapshot_cow",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400183 "libbrotli",
184 "libz",
185 "libpayload_extent_ranges",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500186 "libpayload_extent_utils",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400187 "libcow_operation_convert",
Kelvin Zhang55624032021-12-20 12:13:24 -0800188 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800189 "liblz4patch",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700190 ],
191 shared_libs: [
192 "libbase",
193 "libcrypto",
Sen Jiangb5f631d2018-12-18 16:59:57 -0800194 "libfec",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800195 "liblz4",
Tianjie99d570d2020-06-04 14:57:19 -0700196 "libziparchive",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700197 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700198}
199
200cc_library_static {
201 name: "libpayload_consumer",
202 defaults: [
203 "ue_defaults",
204 "libpayload_consumer_exports",
205 ],
206 host_supported: true,
207 recovery_available: true,
208
209 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700210 "aosp/platform_constants_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700211 "common/action_processor.cc",
212 "common/boot_control_stub.cc",
213 "common/clock.cc",
214 "common/constants.cc",
215 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800216 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700217 "common/error_code_utils.cc",
218 "common/file_fetcher.cc",
219 "common/hash_calculator.cc",
220 "common/http_common.cc",
221 "common/http_fetcher.cc",
222 "common/hwid_override.cc",
223 "common/multi_range_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700224 "common/prefs.cc",
225 "common/proxy_resolver.cc",
226 "common/subprocess.cc",
227 "common/terminator.cc",
228 "common/utils.cc",
229 "payload_consumer/bzip_extent_writer.cc",
230 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700231 "payload_consumer/certificate_parser_android.cc",
Kelvin Zhang569c97e2020-10-26 12:12:24 -0400232 "payload_consumer/cow_writer_file_descriptor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700233 "payload_consumer/delta_performer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700234 "payload_consumer/extent_reader.cc",
235 "payload_consumer/extent_writer.cc",
236 "payload_consumer/file_descriptor.cc",
237 "payload_consumer/file_descriptor_utils.cc",
238 "payload_consumer/file_writer.cc",
239 "payload_consumer/filesystem_verifier_action.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -0500240 "payload_consumer/install_operation_executor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700241 "payload_consumer/install_plan.cc",
242 "payload_consumer/mount_history.cc",
243 "payload_consumer/payload_constants.cc",
244 "payload_consumer/payload_metadata.cc",
245 "payload_consumer/payload_verifier.cc",
Kelvin Zhang50bac652020-09-28 15:51:41 -0400246 "payload_consumer/partition_writer.cc",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400247 "payload_consumer/partition_writer_factory_android.cc",
248 "payload_consumer/vabc_partition_writer.cc",
Kelvin Zhang4bb49202021-07-08 21:39:05 -0400249 "payload_consumer/xor_extent_writer.cc",
Kelvin Zhangb1706762021-06-25 15:05:22 -0400250 "payload_consumer/block_extent_writer.cc",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400251 "payload_consumer/snapshot_extent_writer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700252 "payload_consumer/postinstall_runner_action.cc",
Kelvin Zhangab3ce602021-02-24 14:46:40 -0500253 "payload_consumer/verified_source_fd.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700254 "payload_consumer/verity_writer_android.cc",
255 "payload_consumer/xz_extent_writer.cc",
256 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700257 "payload_consumer/partition_update_generator_android.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700258 "update_status_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700259 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700260}
261
262// libupdate_engine_boot_control (type: static_library)
263// ========================================================
264// A BootControl class implementation using Android's HIDL boot_control HAL.
265cc_defaults {
266 name: "libupdate_engine_boot_control_exports",
267 defaults: ["update_metadata-protos_exports"],
268
Yifan Hong420db9b2019-07-23 20:50:33 -0700269 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800270 "libcutils",
271 "libfs_mgr_binder",
272 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800273 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700274 "libsnapshot",
David Anderson6c190a22020-09-21 17:09:53 -0700275 "libsnapshot_cow",
276 "libz",
Yifan Hong420db9b2019-07-23 20:50:33 -0700277 "update_metadata-protos",
278 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700279 shared_libs: [
280 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700281 "libhidlbase",
282 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800283 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700284 "libutils",
285 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700286 "android.hardware.boot@1.1",
Kelvin Zhangcb419e62021-06-16 13:56:47 -0400287 "android.hardware.boot@1.2",
Kelvin Zhang8251dc02022-06-14 09:46:46 -0700288 "android.hardware.boot-V1-ndk",
Kelvin Zhange9c1d372022-06-13 15:40:44 -0700289 "libboot_control_client",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700290 ],
Yifan Hong29692902020-03-26 12:47:05 -0700291 header_libs: [
292 "avb_headers",
293 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700294 target: {
295 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800296 static_libs: [
297 "libfs_mgr",
298 "libsnapshot_nobinder",
299 ],
300 exclude_static_libs: [
301 "libfs_mgr_binder",
302 "libsnapshot",
303 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800304 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800305 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800306 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700307 },
308 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700309}
310
311cc_library_static {
312 name: "libupdate_engine_boot_control",
313 defaults: [
314 "ue_defaults",
315 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800316 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700317 ],
318 recovery_available: true,
319
320 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700321 "aosp/boot_control_android.cc",
322 "aosp/cleanup_previous_update_action.cc",
323 "aosp/dynamic_partition_control_android.cc",
324 "aosp/dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700325 ],
326}
327
328// libupdate_engine_android (type: static_library)
329// ========================================================
330// The main daemon static_library used in Android (non-Brillo). This only has a
331// loop to apply payloads provided by the upper layer via a Binder interface.
332cc_defaults {
333 name: "libupdate_engine_android_exports",
334 defaults: [
335 "ue_defaults",
336 "libpayload_consumer_exports",
337 "libupdate_engine_boot_control_exports",
338 ],
339
340 static_libs: [
Tianjie838793d2021-01-14 22:05:13 -0800341 "libavb",
342 "libavb_user",
Yifan Hong126d13e2020-09-21 19:50:06 -0700343 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700344 "libpayload_consumer",
345 "libupdate_engine_boot_control",
Tianjie838793d2021-01-14 22:05:13 -0800346 "PlatformProperties",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700347 ],
348 shared_libs: [
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000349 "apex_aidl_interface-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700350 "libandroid_net",
351 "libbase",
352 "libbinder",
353 "libbinderwrapper",
354 "libbootloader_message",
355 "libbrillo-binder",
356 "libcurl",
357 "libcutils",
Jeongik Cha95f89e92021-01-26 22:33:11 +0900358 "libupdate_engine_stable-V1-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700359 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700360 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700361 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700362 "libutils",
363 ],
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100364 whole_static_libs: [
365 "com.android.sysprop.apex",
366 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700367}
368
369cc_library_static {
370 name: "libupdate_engine_android",
371 defaults: [
372 "ue_defaults",
373 "libupdate_engine_android_exports",
374 ],
375
376 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
377 // out of the DBus interface.
378 include_dirs: ["external/cros/system_api/dbus"],
379
380 aidl: {
381 local_include_dirs: ["binder_bindings"],
382 export_aidl_headers: true,
383 },
384
385 srcs: [
386 ":libupdate_engine_aidl",
Amin Hassani538bd592020-11-04 20:46:08 -0800387 "common/system_state.cc",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000388 "aosp/apex_handler_android.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700389 "aosp/binder_service_android.cc",
390 "aosp/binder_service_stable_android.cc",
391 "aosp/daemon_android.cc",
392 "aosp/daemon_state_android.cc",
393 "aosp/hardware_android.cc",
394 "aosp/logging_android.cc",
395 "aosp/network_selector_android.cc",
396 "aosp/update_attempter_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700397 "certificate_checker.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800398 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700399 "libcurl_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700400 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700401 "update_boot_flags_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700402 ],
403}
404
405// update_engine (type: executable)
406// ========================================================
407// update_engine daemon.
408cc_binary {
409 name: "update_engine",
410 defaults: [
411 "ue_defaults",
412 "libupdate_engine_android_exports",
413 ],
414
415 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700416 required: [
417 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700418 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700419 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700420
Amin Hassaniec7bc112020-10-29 16:47:58 -0700421 srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700422 init_rc: ["update_engine.rc"],
423}
424
425// update_engine_sideload (type: executable)
426// ========================================================
427// A binary executable equivalent to update_engine daemon that installs an update
428// from a local file directly instead of running in the background. Used in
429// recovery image.
430cc_binary {
431 name: "update_engine_sideload",
432 defaults: [
433 "ue_defaults",
434 "update_metadata-protos_exports",
435 "libupdate_engine_boot_control_exports",
436 "libpayload_consumer_exports",
437 ],
438 recovery: true,
439
440 cflags: ["-D_UE_SIDELOAD"],
441 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
442 // out of the DBus interface.
443 include_dirs: ["external/cros/system_api/dbus"],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -0700444 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700445
446 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700447 "aosp/hardware_android.cc",
448 "aosp/logging_android.cc",
449 "aosp/sideload_main.cc",
450 "aosp/update_attempter_android.cc",
451 "common/metrics_reporter_stub.cc",
452 "common/network_selector_stub.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800453 "common/system_state.cc",
454 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700455 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700456 "update_boot_flags_action.cc",
457 "update_status_utils.cc",
458 ],
459
460 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
461 // as it doesn't look beneficial to be installed separately due to its size. Note
462 // that we explicitly request their recovery variants, so that the expected files
463 // will be used and installed.
464 shared_libs: [
465 "libbase",
466 "liblog",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800467 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700468 ],
469 static_libs: [
470 "libpayload_consumer",
471 "libupdate_engine_boot_control",
472 "update_metadata-protos",
473
474 // We add the static versions of the shared libraries that are not installed to
475 // recovery image due to size concerns. Need to include all the static library
476 // dependencies of these static libraries.
Yifan Hong126d13e2020-09-21 19:50:06 -0700477 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700478 "libevent",
479 "libmodpb64",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700480 "libprotobuf-cpp-lite",
481 "libbrillo-stream",
482 "libbrillo",
483 "libchrome",
484 ],
485 target: {
486 recovery: {
487 exclude_shared_libs: [
488 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700489 "libbrillo-stream",
490 "libbrillo",
491 "libchrome",
492 ],
493 },
494 },
495
Tao Bao1e1c86c2019-04-18 10:48:32 -0700496 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700497 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700498 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700499}
500
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700501// update_engine_client (type: executable)
502// ========================================================
503// update_engine console client.
504cc_binary {
505 name: "update_engine_client",
506 defaults: ["ue_defaults"],
507
508 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
509 // out of the DBus interface.
510 include_dirs: ["external/cros/system_api/dbus"],
511
512 shared_libs: [
513 "libbinder",
514 "libbinderwrapper",
515 "libbrillo-binder",
516 "libutils",
517 ],
518
519 aidl: {
520 local_include_dirs: ["binder_bindings"],
521 },
522
523 srcs: [
524 ":libupdate_engine_aidl",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700525 "aosp/update_engine_client_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700526 "common/error_code_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700527 "update_status_utils.cc",
528 ],
529}
530
531// libpayload_generator (type: static_library)
532// ========================================================
533// server-side code. This is used for delta_generator and unittests but not
534// for any client code.
535cc_defaults {
536 name: "libpayload_generator_exports",
537 defaults: [
538 "libpayload_consumer_exports",
539 "update_metadata-protos_exports",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800540 "erofs-utils_export_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700541 ],
542
Tianjie37ae8562020-03-25 15:16:01 -0700543 header_libs: [
544 "bootimg_headers",
545 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700546 static_libs: [
547 "libavb",
548 "libbrotli",
549 "libbsdiff",
550 "libdivsufsort",
551 "libdivsufsort64",
552 "liblzma",
553 "libpayload_consumer",
554 "libpuffdiff",
Tianjiea69cfe22021-08-22 23:28:44 -0700555 "libzucchini",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700556 "libverity_tree",
557 "update_metadata-protos",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500558 "libpayload_extent_utils",
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500559 "libcow_size_estimator",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800560 "liberofs",
Kelvin Zhang702ce4c2022-07-14 10:43:22 -0700561 "libselinux",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800562 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800563 "liblz4diff",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700564 ],
565 shared_libs: [
566 "libbase",
567 "libext2fs",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800568 // LZ4 has to be a shared lib, as we want to override it with
569 // LD_LIBRARY_PRELOAD later
570 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700571 ],
572}
573
574cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000575 name: "libpayload_extent_ranges",
576 defaults: [
577 "ue_defaults",
578 ],
579 host_supported: true,
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400580 recovery_available: true,
David Andersonc1c93052020-08-26 18:22:09 +0000581 srcs: [
582 "payload_generator/extent_ranges.cc",
583 ],
584 static_libs: [
585 "update_metadata-protos",
586 ],
587}
588
589cc_library_static {
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500590 name: "libcow_size_estimator",
591 defaults: [
592 "ue_defaults",
593 "update_metadata-protos_exports"
594 ],
595 host_supported: true,
596 recovery_available: true,
597 srcs: [
598 "payload_generator/cow_size_estimator.cc",
599 ],
600 static_libs: [
601 "update_metadata-protos",
602 "libbase",
603 "libsnapshot_cow",
604 "libcow_operation_convert",
605 ],
606}
607
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800608cc_defaults {
609 name: "liblz4diff_defaults",
610 static_libs: [
611 "lz4diff-protos",
612 "update_metadata-protos",
613 "libssl",
614 "libbsdiff",
615 "libpuffdiff",
616 ],
617 shared_libs: [
618 "liblz4",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800619 ],
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800620}
621
622cc_library_static {
623 name: "liblz4diff",
624 host_supported: true,
625 defaults: ["ue_defaults", "liblz4diff_defaults"],
626 srcs: [
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800627 "lz4diff/lz4diff.cc",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800628 "lz4diff/lz4diff_compress.cc",
629 ],
630}
631
632cc_library_static {
633 name: "liblz4patch",
634 host_supported: true,
635 recovery_available: true,
636 defaults: ["ue_defaults"],
637 static_libs: [
638 "lz4diff-protos",
639 "update_metadata-protos",
640 "libssl",
641 "libbspatch",
642 "libpuffpatch",
643 ],
644 shared_libs: [
645 "liblz4",
646 ],
647 srcs: [
648 "lz4diff/lz4patch.cc",
649 "lz4diff/lz4diff_compress.cc",
650 ],
651}
652
Kelvin Zhang35cff4f2021-12-08 16:06:00 -0800653cc_binary_host {
654 name: "lz4diff",
655 defaults: [
656 "ue_defaults",
657 "libpayload_generator_exports",
658 ],
659 static_libs: [
660 "libpayload_generator",
661 "liblz4diff",
662 "liblz4patch",
663 ],
664 srcs: [
665 "lz4diff/lz4diff_main.cc",
666 ],
667}
668
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500669cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700670 name: "libpayload_generator",
671 defaults: [
672 "ue_defaults",
673 "libpayload_generator_exports",
674 ],
675 host_supported: true,
676
677 srcs: [
Amin Hassani538bd592020-11-04 20:46:08 -0800678 "common/system_state.cc",
679 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700680 "payload_generator/ab_generator.cc",
681 "payload_generator/annotated_operation.cc",
682 "payload_generator/blob_file_writer.cc",
683 "payload_generator/block_mapping.cc",
684 "payload_generator/boot_img_filesystem.cc",
685 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700686 "payload_generator/deflate_utils.cc",
687 "payload_generator/delta_diff_generator.cc",
688 "payload_generator/delta_diff_utils.cc",
689 "payload_generator/ext2_filesystem.cc",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800690 "payload_generator/erofs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700691 "payload_generator/extent_ranges.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700692 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700693 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700694 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700695 "payload_generator/payload_file.cc",
696 "payload_generator/payload_generation_config_android.cc",
697 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700698 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700699 "payload_generator/payload_signer.cc",
700 "payload_generator/raw_filesystem.cc",
701 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700702 "payload_generator/xz_android.cc",
703 ],
704}
705
706// delta_generator (type: executable)
707// ========================================================
708// server-side delta generator.
709cc_binary_host {
710 name: "delta_generator",
711 defaults: [
712 "ue_defaults",
713 "libpayload_generator_exports",
714 "libpayload_consumer_exports",
715 ],
716
717 static_libs: [
718 "libavb_host_sysdeps",
719 "libpayload_consumer",
720 "libpayload_generator",
721 ],
722
723 srcs: ["payload_generator/generate_delta_main.cc"],
724}
725
726cc_test {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700727 host_supported: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700728 name: "ue_unittest_delta_generator",
729 defaults: [
730 "ue_defaults",
731 "libpayload_generator_exports",
732 "libpayload_consumer_exports",
733 ],
734
735 static_libs: [
736 "libpayload_consumer",
737 "libpayload_generator",
738 ],
739
740 srcs: ["payload_generator/generate_delta_main.cc"],
741
742 gtest: false,
743 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700744}
745
746// test_http_server (type: executable)
747// ========================================================
748// Test HTTP Server.
749cc_test {
750 name: "test_http_server",
751 defaults: ["ue_defaults"],
752 srcs: [
753 "common/http_common.cc",
754 "test_http_server.cc",
755 ],
756
757 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700758}
759
760// test_subprocess (type: executable)
761// ========================================================
762// Test helper subprocess program.
763cc_test {
764 name: "test_subprocess",
765 defaults: ["ue_defaults"],
766 srcs: ["test_subprocess.cc"],
767
768 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700769}
770
771// Public keys for unittests.
772// ========================================================
773genrule {
774 name: "ue_unittest_keys",
775 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700776 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700777 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
778 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700779 srcs: [
780 "unittest_key.pem",
781 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700782 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700783 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700784 ],
785 out: [
786 "unittest_key.pub.pem",
787 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700788 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700789 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700790 ],
791}
792
793// Sample images for unittests.
794// ========================================================
795// Extract sample image from the compressed sample_images.tar.bz2 file used by
796// the unittests.
797genrule {
798 name: "ue_unittest_disk_imgs",
799 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
800 srcs: ["sample_images/sample_images.tar.bz2"],
801 out: [
802 "gen/disk_ext2_1k.img",
803 "gen/disk_ext2_4k.img",
804 "gen/disk_ext2_4k_empty.img",
805 "gen/disk_ext2_unittest.img",
806 ],
807}
808
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800809genrule {
810 name: "ue_unittest_erofs_imgs",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800811 cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " +
812 "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " +
813 "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800814 srcs: ["sample_images/generate_test_erofs_images.sh"],
815 out: [
816 "gen/erofs.img",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800817 "gen/erofs_new.img",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800818 "gen/erofs_empty.img",
819 ],
820 tools: [
821 "mkfs.erofs",
822 "delta_generator",
823 ],
824}
825
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700826filegroup {
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800827 name: "update_engine_host_unittest_timeout_srcs",
828 srcs: [
829 "common/action_processor_unittest.cc",
830 "common/file_fetcher_unittest.cc",
831 "payload_generator/delta_diff_utils_unittest.cc",
832 ],
833}
834
835filegroup {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700836 name: "update_engine_host_unittest_srcs",
837 srcs: [
838 "common/action_pipe_unittest.cc",
839 "common/action_processor_unittest.cc",
840 "common/action_unittest.cc",
841 "common/cow_operation_convert_unittest.cc",
842 "common/cpu_limiter_unittest.cc",
843 "common/fake_prefs.cc",
844 "common/file_fetcher_unittest.cc",
845 "common/hash_calculator_unittest.cc",
846 "common/hwid_override_unittest.cc",
847 "common/metrics_reporter_stub.cc",
848 "common/mock_http_fetcher.cc",
849 "common/prefs_unittest.cc",
850 "common/terminator_unittest.cc",
851 "common/test_utils.cc",
Kelvin Zhang55624032021-12-20 12:13:24 -0800852 "lz4diff/lz4diff_compress_unittest.cc",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800853 "lz4diff/lz4diff_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700854 "payload_generator/ab_generator_unittest.cc",
855 "payload_generator/blob_file_writer_unittest.cc",
856 "payload_generator/block_mapping_unittest.cc",
857 "payload_generator/boot_img_filesystem_unittest.cc",
858 "payload_generator/deflate_utils_unittest.cc",
859 "payload_generator/delta_diff_utils_unittest.cc",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800860 "payload_generator/erofs_filesystem_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700861 "payload_generator/ext2_filesystem_unittest.cc",
862 "payload_generator/extent_ranges_unittest.cc",
863 "payload_generator/extent_utils_unittest.cc",
864 "payload_generator/fake_filesystem.cc",
865 "payload_generator/full_update_generator_unittest.cc",
866 "payload_generator/mapfile_filesystem_unittest.cc",
867 "payload_generator/merge_sequence_generator_unittest.cc",
868 "payload_generator/payload_file_unittest.cc",
869 "payload_generator/payload_generation_config_android_unittest.cc",
870 "payload_generator/payload_generation_config_unittest.cc",
871 "payload_generator/payload_properties_unittest.cc",
872 "payload_generator/payload_signer_unittest.cc",
873 "payload_generator/squashfs_filesystem_unittest.cc",
874 "payload_generator/zip_unittest.cc",
Kelvin Zhange4bffe62022-03-07 09:08:38 -0800875 "payload_consumer/verity_writer_android_unittest.cc",
876 "payload_consumer/xz_extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700877 "testrunner.cc",
878 ],
879}
880
881cc_test_host {
882 name: "update_engine_host_unittests",
883 defaults: [
884 "ue_defaults",
885 "libpayload_generator_exports",
886 ],
887 strip: {
888 none: true,
889 },
890 cflags: [
891 "-g3",
892 ],
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800893 tidy_timeout_srcs: [":update_engine_host_unittest_timeout_srcs"],
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700894 srcs: [":update_engine_host_unittest_srcs"],
895 data: [
896 ":ue_unittest_delta_generator",
897 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800898 ":ue_unittest_erofs_imgs",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700899 ":ue_unittest_keys",
900 "otacerts.zip",
901 "unittest_key.pem",
902 "unittest_key2.pem",
903 "unittest_key_RSA4096.pem",
904 "unittest_key_EC.pem",
905 "update_engine.conf",
906 ],
907 static_libs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700908 "libgmock",
909 "libpayload_generator",
910 ],
911}
912
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700913// update_engine_unittests (type: executable)
914// ========================================================
915// Main unittest file.
916cc_test {
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700917 name: "update_engine_http_unittests",
918 defaults: [
919 "ue_defaults",
920 "liblz4diff_defaults",
921 "update_metadata-protos_exports",
922 ],
923 require_root: true,
924 static_libs: [
925 "libbase",
926 "libbrillo-test-helpers",
927 "libchrome_test_helpers",
928 "libcurl",
929 "libcutils",
930 "libdm",
931 "libgmock",
932 "libz",
933 ],
934 shared_libs: [
935 "libssl",
936 "libcrypto",
937 "libziparchive",
938 "liblog",
939 ],
940
941 data: [
942 ":test_http_server",
943 ":test_subprocess",
944 ":ue_unittest_keys",
945 "otacerts.zip",
946 "unittest_key.pem",
947 "unittest_key2.pem",
948 "unittest_key_RSA4096.pem",
949 "unittest_key_EC.pem",
950 ],
951
952 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
953 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
954 // test_config: "test_config.xml",
955 test_suites: ["device-tests"],
956
957 srcs: [
958 "aosp/platform_constants_android.cc",
959 "certificate_checker.cc",
960 "common/action_processor.cc",
961 "common/boot_control_stub.cc",
962 "common/error_code_utils.cc",
963 "common/file_fetcher.cc",
964 "common/hash_calculator.cc",
965 "common/http_fetcher.cc",
966 "common/multi_range_http_fetcher.cc",
967 "common/http_common.cc",
968 "common/subprocess.cc",
969 "common/test_utils.cc",
970 "common/utils.cc",
971 "common/proxy_resolver.cc",
972 "libcurl_http_fetcher.cc",
973 "payload_consumer/certificate_parser_android.cc",
974 "payload_consumer/payload_verifier.cc",
975 "payload_generator/payload_signer.cc",
976 "update_status_utils.cc",
977
978 "certificate_checker_unittest.cc",
979 "common/http_fetcher_unittest.cc",
980 "common/mock_http_fetcher.cc",
981 "common/proxy_resolver_unittest.cc",
982 "common/subprocess_unittest.cc",
983 "libcurl_http_fetcher_unittest.cc",
984 "payload_consumer/certificate_parser_android_unittest.cc",
985 "update_status_utils_unittest.cc",
986 ],
987}
988
989// update_engine_unittests (type: executable)
990// ========================================================
991// Main unittest file.
992cc_test {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700993 name: "update_engine_unittests",
994 defaults: [
995 "ue_defaults",
996 "libpayload_generator_exports",
997 "libupdate_engine_android_exports",
998 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700999
1000 static_libs: [
1001 "libpayload_generator",
1002 "libbrillo-test-helpers",
1003 "libgmock",
1004 "libchrome_test_helpers",
1005 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -08001006 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001007 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001008
Yifan Hong87ea73f2019-09-12 13:07:37 -07001009 header_libs: [
1010 "libstorage_literals_headers",
1011 ],
1012
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001013 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -07001014 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001015 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001016 ":ue_unittest_erofs_imgs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001017 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -07001018 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001019 "unittest_key.pem",
1020 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -07001021 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -07001022 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001023 "update_engine.conf",
1024 ],
1025
Tao Bao9456b6f2019-04-29 18:14:58 -07001026 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1027 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1028 test_config: "test_config.xml",
1029 test_suites: ["device-tests"],
1030
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001031 tidy_timeout_srcs: [
1032 ":update_engine_host_unittest_timeout_srcs",
1033 "aosp/dynamic_partition_control_android_unittest.cc",
1034 "common/http_fetcher_unittest.cc",
1035 "payload_consumer/delta_performer_integration_test.cc",
1036 "payload_consumer/delta_performer_unittest.cc",
1037 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001038 srcs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001039 ":update_engine_host_unittest_srcs",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +00001040 "aosp/apex_handler_android_unittest.cc",
Kelvin Zhangb4b95c22021-04-05 15:56:26 -04001041 "aosp/cleanup_previous_update_action_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001042 "aosp/dynamic_partition_control_android_unittest.cc",
Kelvin Zhang3fe49642021-10-04 15:35:02 -07001043 "aosp/update_attempter_android_integration_test.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001044 "aosp/update_attempter_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001045 "common/utils_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001046 "download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001047 "payload_consumer/bzip_extent_writer_unittest.cc",
1048 "payload_consumer/cached_file_descriptor_unittest.cc",
Kelvin Zhang46d6c492021-04-26 17:51:25 -04001049 "payload_consumer/cow_writer_file_descriptor_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001050 "payload_consumer/delta_performer_integration_test.cc",
1051 "payload_consumer/delta_performer_unittest.cc",
1052 "payload_consumer/extent_reader_unittest.cc",
1053 "payload_consumer/extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001054 "payload_consumer/extent_map_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001055 "payload_consumer/fake_file_descriptor.cc",
1056 "payload_consumer/file_descriptor_utils_unittest.cc",
1057 "payload_consumer/file_writer_unittest.cc",
1058 "payload_consumer/filesystem_verifier_action_unittest.cc",
Amin Hassani23795032020-11-24 14:38:55 -08001059 "payload_consumer/install_plan_unittest.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -05001060 "payload_consumer/install_operation_executor_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -07001061 "payload_consumer/partition_update_generator_android_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001062 "payload_consumer/partition_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001063 "payload_consumer/postinstall_runner_action_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001064 "payload_consumer/snapshot_extent_writer_unittest.cc",
1065 "payload_consumer/vabc_partition_writer_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001066 "payload_consumer/xor_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001067 ],
1068}
1069
1070// Brillo update payload generation script
1071// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001072sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001073 name: "brillo_update_payload",
1074 device_supported: false,
1075 host_supported: true,
1076
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001077 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001078 required: [
1079 "delta_generator",
1080 "shflags",
1081 "simg2img",
1082 ],
1083
1084 target: {
1085 darwin: {
1086 enabled: false,
1087 },
1088 },
Colin Cross606913a2017-11-14 13:05:37 -08001089}
Yifan Hongd51738c2020-07-23 17:06:25 -07001090
1091// update_engine header library
1092cc_library_headers {
1093 name: "libupdate_engine_headers",
Yifan Hong309c8a82020-10-06 18:31:08 -07001094
1095 // This header library is available to core and product modules.
Justin Yun6d121de2020-11-11 19:31:57 +09001096 product_available: true,
Yifan Hong309c8a82020-10-06 18:31:08 -07001097
Yifan Hongd51738c2020-07-23 17:06:25 -07001098 export_include_dirs: ["."],
1099 apex_available: [
1100 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -07001101 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -07001102 ],
David Andersonc1c93052020-08-26 18:22:09 +00001103 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001104 recovery_available: true,
1105 ramdisk_available: true,
1106
1107 target: {
1108 darwin: {
1109 enabled: false,
1110 },
1111 }
Yifan Hongd51738c2020-07-23 17:06:25 -07001112}
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001113
1114cc_binary_host {
1115 name: "cow_converter",
1116 defaults: [
1117 "ue_defaults",
1118 "libpayload_consumer_exports",
1119 ],
1120 srcs: [
1121 "aosp/cow_converter.cc",
1122 ],
1123 static_libs: [
1124 "liblog",
1125 "libbrotli",
1126 "libbase",
1127 "libcow_operation_convert",
1128 "libcow_size_estimator",
1129 "libpayload_consumer",
1130 "libpayload_extent_ranges",
1131 "libpayload_extent_utils",
1132 "libsnapshot_cow",
1133 "libz",
1134 "update_metadata-protos",
1135 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -07001136}
Kelvin Zhang98001b22021-12-08 14:10:11 -08001137
1138cc_library_static {
1139 name: "lz4diff-protos",
1140 host_supported: true,
1141 ramdisk_available: true,
1142 recovery_available: true,
1143
1144 srcs: ["lz4diff/lz4diff.proto"],
1145 cflags: [
1146 "-Wall",
1147 "-Werror",
1148 ],
1149 proto: {
1150 canonical_path_from_root: false,
1151 export_proto_headers: true,
1152 },
1153}
Kelvin Zhang596a3202022-03-07 14:13:42 -08001154
1155cc_binary_host {
1156 name: "ota_extractor",
1157 defaults: [
1158 "ue_defaults",
1159 "libpayload_consumer_exports",
1160 ],
1161 srcs: [
1162 "aosp/ota_extractor.cc",
1163 ],
1164 static_libs: [
1165 "liblog",
1166 "libbrotli",
1167 "libbase",
1168 "libpayload_consumer",
1169 "libpayload_extent_ranges",
1170 "libpayload_extent_utils",
1171 "libz",
1172 "libgflags",
1173 "update_metadata-protos",
1174 ],
1175}