blob: b7b4cd404b021a9125af071b62e5c31b047f46b6 [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",
Gabriele M4c376812018-06-14 01:10:09 +0200197 "libprocessgroup",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700198 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700199}
200
201cc_library_static {
202 name: "libpayload_consumer",
203 defaults: [
204 "ue_defaults",
205 "libpayload_consumer_exports",
206 ],
207 host_supported: true,
208 recovery_available: true,
209
210 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700211 "aosp/platform_constants_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700212 "common/action_processor.cc",
213 "common/boot_control_stub.cc",
214 "common/clock.cc",
215 "common/constants.cc",
216 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800217 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700218 "common/error_code_utils.cc",
219 "common/file_fetcher.cc",
220 "common/hash_calculator.cc",
221 "common/http_common.cc",
222 "common/http_fetcher.cc",
223 "common/hwid_override.cc",
224 "common/multi_range_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700225 "common/prefs.cc",
226 "common/proxy_resolver.cc",
227 "common/subprocess.cc",
228 "common/terminator.cc",
229 "common/utils.cc",
230 "payload_consumer/bzip_extent_writer.cc",
231 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700232 "payload_consumer/certificate_parser_android.cc",
Kelvin Zhang569c97e2020-10-26 12:12:24 -0400233 "payload_consumer/cow_writer_file_descriptor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700234 "payload_consumer/delta_performer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700235 "payload_consumer/extent_reader.cc",
236 "payload_consumer/extent_writer.cc",
237 "payload_consumer/file_descriptor.cc",
238 "payload_consumer/file_descriptor_utils.cc",
239 "payload_consumer/file_writer.cc",
240 "payload_consumer/filesystem_verifier_action.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -0500241 "payload_consumer/install_operation_executor.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700242 "payload_consumer/install_plan.cc",
243 "payload_consumer/mount_history.cc",
244 "payload_consumer/payload_constants.cc",
245 "payload_consumer/payload_metadata.cc",
246 "payload_consumer/payload_verifier.cc",
Kelvin Zhang50bac652020-09-28 15:51:41 -0400247 "payload_consumer/partition_writer.cc",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400248 "payload_consumer/partition_writer_factory_android.cc",
249 "payload_consumer/vabc_partition_writer.cc",
Kelvin Zhang4bb49202021-07-08 21:39:05 -0400250 "payload_consumer/xor_extent_writer.cc",
Kelvin Zhangb1706762021-06-25 15:05:22 -0400251 "payload_consumer/block_extent_writer.cc",
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400252 "payload_consumer/snapshot_extent_writer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700253 "payload_consumer/postinstall_runner_action.cc",
Kelvin Zhangab3ce602021-02-24 14:46:40 -0500254 "payload_consumer/verified_source_fd.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700255 "payload_consumer/verity_writer_android.cc",
256 "payload_consumer/xz_extent_writer.cc",
257 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700258 "payload_consumer/partition_update_generator_android.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700259 "update_status_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700260 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700261}
262
263// libupdate_engine_boot_control (type: static_library)
264// ========================================================
265// A BootControl class implementation using Android's HIDL boot_control HAL.
266cc_defaults {
267 name: "libupdate_engine_boot_control_exports",
268 defaults: ["update_metadata-protos_exports"],
269
Yifan Hong420db9b2019-07-23 20:50:33 -0700270 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800271 "libcutils",
272 "libfs_mgr_binder",
273 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800274 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700275 "libsnapshot",
David Anderson6c190a22020-09-21 17:09:53 -0700276 "libsnapshot_cow",
277 "libz",
Yifan Hong420db9b2019-07-23 20:50:33 -0700278 "update_metadata-protos",
279 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700280 shared_libs: [
281 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700282 "libhidlbase",
283 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800284 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700285 "libutils",
286 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700287 "android.hardware.boot@1.1",
Kelvin Zhangcb419e62021-06-16 13:56:47 -0400288 "android.hardware.boot@1.2",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700289 ],
Yifan Hong29692902020-03-26 12:47:05 -0700290 header_libs: [
291 "avb_headers",
292 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700293 target: {
294 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800295 static_libs: [
296 "libfs_mgr",
297 "libsnapshot_nobinder",
298 ],
299 exclude_static_libs: [
300 "libfs_mgr_binder",
301 "libsnapshot",
302 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800303 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800304 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800305 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700306 },
307 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700308}
309
310cc_library_static {
311 name: "libupdate_engine_boot_control",
312 defaults: [
313 "ue_defaults",
314 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800315 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700316 ],
317 recovery_available: true,
318
319 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700320 "aosp/boot_control_android.cc",
321 "aosp/cleanup_previous_update_action.cc",
322 "aosp/dynamic_partition_control_android.cc",
323 "aosp/dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700324 ],
325}
326
327// libupdate_engine_android (type: static_library)
328// ========================================================
329// The main daemon static_library used in Android (non-Brillo). This only has a
330// loop to apply payloads provided by the upper layer via a Binder interface.
331cc_defaults {
332 name: "libupdate_engine_android_exports",
333 defaults: [
334 "ue_defaults",
335 "libpayload_consumer_exports",
336 "libupdate_engine_boot_control_exports",
337 ],
338
339 static_libs: [
Tianjie838793d2021-01-14 22:05:13 -0800340 "libavb",
341 "libavb_user",
Yifan Hong126d13e2020-09-21 19:50:06 -0700342 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700343 "libpayload_consumer",
344 "libupdate_engine_boot_control",
Tianjie838793d2021-01-14 22:05:13 -0800345 "PlatformProperties",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700346 ],
347 shared_libs: [
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000348 "apex_aidl_interface-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700349 "libandroid_net",
350 "libbase",
351 "libbinder",
352 "libbinderwrapper",
353 "libbootloader_message",
354 "libbrillo-binder",
355 "libcurl",
356 "libcutils",
Jeongik Cha95f89e92021-01-26 22:33:11 +0900357 "libupdate_engine_stable-V1-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700358 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700359 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700360 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700361 "libutils",
362 ],
Nikita Ioffeaedfef32021-04-28 13:54:14 +0100363 whole_static_libs: [
364 "com.android.sysprop.apex",
365 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700366}
367
368cc_library_static {
369 name: "libupdate_engine_android",
370 defaults: [
371 "ue_defaults",
372 "libupdate_engine_android_exports",
373 ],
374
375 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
376 // out of the DBus interface.
377 include_dirs: ["external/cros/system_api/dbus"],
378
379 aidl: {
380 local_include_dirs: ["binder_bindings"],
381 export_aidl_headers: true,
382 },
383
384 srcs: [
385 ":libupdate_engine_aidl",
Amin Hassani538bd592020-11-04 20:46:08 -0800386 "common/system_state.cc",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +0000387 "aosp/apex_handler_android.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700388 "aosp/binder_service_android.cc",
389 "aosp/binder_service_stable_android.cc",
390 "aosp/daemon_android.cc",
391 "aosp/daemon_state_android.cc",
392 "aosp/hardware_android.cc",
393 "aosp/logging_android.cc",
394 "aosp/network_selector_android.cc",
395 "aosp/update_attempter_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700396 "certificate_checker.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800397 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700398 "libcurl_http_fetcher.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700399 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700400 "update_boot_flags_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700401 ],
402}
403
404// update_engine (type: executable)
405// ========================================================
406// update_engine daemon.
407cc_binary {
408 name: "update_engine",
409 defaults: [
410 "ue_defaults",
411 "libupdate_engine_android_exports",
412 ],
413
414 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700415 required: [
416 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700417 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700418 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700419
Amin Hassaniec7bc112020-10-29 16:47:58 -0700420 srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700421 init_rc: ["update_engine.rc"],
422}
423
424// update_engine_sideload (type: executable)
425// ========================================================
426// A binary executable equivalent to update_engine daemon that installs an update
427// from a local file directly instead of running in the background. Used in
428// recovery image.
429cc_binary {
430 name: "update_engine_sideload",
431 defaults: [
432 "ue_defaults",
433 "update_metadata-protos_exports",
434 "libupdate_engine_boot_control_exports",
435 "libpayload_consumer_exports",
436 ],
437 recovery: true,
438
439 cflags: ["-D_UE_SIDELOAD"],
440 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
441 // out of the DBus interface.
442 include_dirs: ["external/cros/system_api/dbus"],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -0700443 header_libs: ["libgtest_prod_headers"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700444
445 srcs: [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700446 "aosp/hardware_android.cc",
447 "aosp/logging_android.cc",
448 "aosp/sideload_main.cc",
449 "aosp/update_attempter_android.cc",
450 "common/metrics_reporter_stub.cc",
451 "common/network_selector_stub.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800452 "common/system_state.cc",
453 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700454 "metrics_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700455 "update_boot_flags_action.cc",
456 "update_status_utils.cc",
457 ],
458
459 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
460 // as it doesn't look beneficial to be installed separately due to its size. Note
461 // that we explicitly request their recovery variants, so that the expected files
462 // will be used and installed.
463 shared_libs: [
464 "libbase",
465 "liblog",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800466 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700467 ],
468 static_libs: [
469 "libpayload_consumer",
470 "libupdate_engine_boot_control",
471 "update_metadata-protos",
472
473 // We add the static versions of the shared libraries that are not installed to
474 // recovery image due to size concerns. Need to include all the static library
475 // dependencies of these static libraries.
Yifan Hong126d13e2020-09-21 19:50:06 -0700476 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700477 "libevent",
478 "libmodpb64",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700479 "libprotobuf-cpp-lite",
480 "libbrillo-stream",
481 "libbrillo",
482 "libchrome",
483 ],
484 target: {
485 recovery: {
486 exclude_shared_libs: [
487 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700488 "libbrillo-stream",
489 "libbrillo",
490 "libchrome",
491 ],
492 },
493 },
494
Tao Bao1e1c86c2019-04-18 10:48:32 -0700495 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700496 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700497 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700498}
499
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700500// update_engine_client (type: executable)
501// ========================================================
502// update_engine console client.
503cc_binary {
504 name: "update_engine_client",
505 defaults: ["ue_defaults"],
506
507 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
508 // out of the DBus interface.
509 include_dirs: ["external/cros/system_api/dbus"],
510
511 shared_libs: [
512 "libbinder",
513 "libbinderwrapper",
514 "libbrillo-binder",
515 "libutils",
516 ],
517
518 aidl: {
519 local_include_dirs: ["binder_bindings"],
520 },
521
522 srcs: [
523 ":libupdate_engine_aidl",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700524 "aosp/update_engine_client_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700525 "common/error_code_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700526 "update_status_utils.cc",
527 ],
528}
529
530// libpayload_generator (type: static_library)
531// ========================================================
532// server-side code. This is used for delta_generator and unittests but not
533// for any client code.
534cc_defaults {
535 name: "libpayload_generator_exports",
536 defaults: [
537 "libpayload_consumer_exports",
538 "update_metadata-protos_exports",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800539 "erofs-utils_export_defaults",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700540 ],
541
Tianjie37ae8562020-03-25 15:16:01 -0700542 header_libs: [
543 "bootimg_headers",
544 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700545 static_libs: [
546 "libavb",
547 "libbrotli",
548 "libbsdiff",
549 "libdivsufsort",
550 "libdivsufsort64",
551 "liblzma",
552 "libpayload_consumer",
553 "libpuffdiff",
Tianjiea69cfe22021-08-22 23:28:44 -0700554 "libzucchini",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700555 "libverity_tree",
556 "update_metadata-protos",
Kelvin Zhangeb8703b2020-12-10 14:17:21 -0500557 "libpayload_extent_utils",
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500558 "libcow_size_estimator",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800559 "liberofs",
560 "lz4diff-protos",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800561 "liblz4diff",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700562 ],
563 shared_libs: [
564 "libbase",
565 "libext2fs",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800566 // LZ4 has to be a shared lib, as we want to override it with
567 // LD_LIBRARY_PRELOAD later
568 "liblz4",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700569 ],
570}
571
572cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000573 name: "libpayload_extent_ranges",
574 defaults: [
575 "ue_defaults",
576 ],
577 host_supported: true,
Kelvin Zhang9b10dba2020-09-25 17:09:11 -0400578 recovery_available: true,
David Andersonc1c93052020-08-26 18:22:09 +0000579 srcs: [
580 "payload_generator/extent_ranges.cc",
581 ],
582 static_libs: [
583 "update_metadata-protos",
584 ],
585}
586
587cc_library_static {
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500588 name: "libcow_size_estimator",
589 defaults: [
590 "ue_defaults",
591 "update_metadata-protos_exports"
592 ],
593 host_supported: true,
594 recovery_available: true,
595 srcs: [
596 "payload_generator/cow_size_estimator.cc",
597 ],
598 static_libs: [
599 "update_metadata-protos",
600 "libbase",
601 "libsnapshot_cow",
602 "libcow_operation_convert",
603 ],
604}
605
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800606cc_defaults {
607 name: "liblz4diff_defaults",
608 static_libs: [
609 "lz4diff-protos",
610 "update_metadata-protos",
611 "libssl",
612 "libbsdiff",
613 "libpuffdiff",
614 ],
615 shared_libs: [
616 "liblz4",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800617 ],
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800618}
619
620cc_library_static {
621 name: "liblz4diff",
622 host_supported: true,
623 defaults: ["ue_defaults", "liblz4diff_defaults"],
624 srcs: [
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800625 "lz4diff/lz4diff.cc",
Kelvin Zhang4eae81e2021-12-09 17:07:17 -0800626 "lz4diff/lz4diff_compress.cc",
627 ],
628}
629
630cc_library_static {
631 name: "liblz4patch",
632 host_supported: true,
633 recovery_available: true,
634 defaults: ["ue_defaults"],
635 static_libs: [
636 "lz4diff-protos",
637 "update_metadata-protos",
638 "libssl",
639 "libbspatch",
640 "libpuffpatch",
641 ],
642 shared_libs: [
643 "liblz4",
644 ],
645 srcs: [
646 "lz4diff/lz4patch.cc",
647 "lz4diff/lz4diff_compress.cc",
648 ],
649}
650
Kelvin Zhang35cff4f2021-12-08 16:06:00 -0800651cc_binary_host {
652 name: "lz4diff",
653 defaults: [
654 "ue_defaults",
655 "libpayload_generator_exports",
656 ],
657 static_libs: [
658 "libpayload_generator",
659 "liblz4diff",
660 "liblz4patch",
661 ],
662 srcs: [
663 "lz4diff/lz4diff_main.cc",
664 ],
665}
666
Kelvin Zhangb93055f2021-02-03 14:22:35 -0500667cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700668 name: "libpayload_generator",
669 defaults: [
670 "ue_defaults",
671 "libpayload_generator_exports",
672 ],
673 host_supported: true,
674
675 srcs: [
Amin Hassani538bd592020-11-04 20:46:08 -0800676 "common/system_state.cc",
677 "download_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700678 "payload_generator/ab_generator.cc",
679 "payload_generator/annotated_operation.cc",
680 "payload_generator/blob_file_writer.cc",
681 "payload_generator/block_mapping.cc",
682 "payload_generator/boot_img_filesystem.cc",
683 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700684 "payload_generator/deflate_utils.cc",
685 "payload_generator/delta_diff_generator.cc",
686 "payload_generator/delta_diff_utils.cc",
687 "payload_generator/ext2_filesystem.cc",
Kelvin Zhang446989a2021-12-08 13:49:07 -0800688 "payload_generator/erofs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700689 "payload_generator/extent_ranges.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700690 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700691 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700692 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700693 "payload_generator/payload_file.cc",
694 "payload_generator/payload_generation_config_android.cc",
695 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700696 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700697 "payload_generator/payload_signer.cc",
698 "payload_generator/raw_filesystem.cc",
699 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700700 "payload_generator/xz_android.cc",
701 ],
702}
703
704// delta_generator (type: executable)
705// ========================================================
706// server-side delta generator.
707cc_binary_host {
708 name: "delta_generator",
709 defaults: [
710 "ue_defaults",
711 "libpayload_generator_exports",
712 "libpayload_consumer_exports",
713 ],
714
715 static_libs: [
716 "libavb_host_sysdeps",
717 "libpayload_consumer",
718 "libpayload_generator",
719 ],
720
721 srcs: ["payload_generator/generate_delta_main.cc"],
722}
723
724cc_test {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700725 host_supported: true,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700726 name: "ue_unittest_delta_generator",
727 defaults: [
728 "ue_defaults",
729 "libpayload_generator_exports",
730 "libpayload_consumer_exports",
731 ],
732
733 static_libs: [
734 "libpayload_consumer",
735 "libpayload_generator",
736 ],
737
738 srcs: ["payload_generator/generate_delta_main.cc"],
739
740 gtest: false,
741 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700742}
743
744// test_http_server (type: executable)
745// ========================================================
746// Test HTTP Server.
747cc_test {
748 name: "test_http_server",
749 defaults: ["ue_defaults"],
750 srcs: [
751 "common/http_common.cc",
752 "test_http_server.cc",
753 ],
754
755 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700756}
757
758// test_subprocess (type: executable)
759// ========================================================
760// Test helper subprocess program.
761cc_test {
762 name: "test_subprocess",
763 defaults: ["ue_defaults"],
764 srcs: ["test_subprocess.cc"],
765
766 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700767}
768
769// Public keys for unittests.
770// ========================================================
771genrule {
772 name: "ue_unittest_keys",
773 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700774 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700775 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
776 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700777 srcs: [
778 "unittest_key.pem",
779 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700780 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700781 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700782 ],
783 out: [
784 "unittest_key.pub.pem",
785 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700786 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700787 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700788 ],
789}
790
791// Sample images for unittests.
792// ========================================================
793// Extract sample image from the compressed sample_images.tar.bz2 file used by
794// the unittests.
795genrule {
796 name: "ue_unittest_disk_imgs",
797 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
798 srcs: ["sample_images/sample_images.tar.bz2"],
799 out: [
800 "gen/disk_ext2_1k.img",
801 "gen/disk_ext2_4k.img",
802 "gen/disk_ext2_4k_empty.img",
803 "gen/disk_ext2_unittest.img",
804 ],
805}
806
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800807genrule {
808 name: "ue_unittest_erofs_imgs",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800809 cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " +
810 "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " +
811 "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800812 srcs: ["sample_images/generate_test_erofs_images.sh"],
813 out: [
814 "gen/erofs.img",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800815 "gen/erofs_new.img",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800816 "gen/erofs_empty.img",
817 ],
818 tools: [
819 "mkfs.erofs",
820 "delta_generator",
821 ],
822}
823
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700824filegroup {
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800825 name: "update_engine_host_unittest_timeout_srcs",
826 srcs: [
827 "common/action_processor_unittest.cc",
828 "common/file_fetcher_unittest.cc",
829 "payload_generator/delta_diff_utils_unittest.cc",
830 ],
831}
832
833filegroup {
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700834 name: "update_engine_host_unittest_srcs",
835 srcs: [
836 "common/action_pipe_unittest.cc",
837 "common/action_processor_unittest.cc",
838 "common/action_unittest.cc",
839 "common/cow_operation_convert_unittest.cc",
840 "common/cpu_limiter_unittest.cc",
841 "common/fake_prefs.cc",
842 "common/file_fetcher_unittest.cc",
843 "common/hash_calculator_unittest.cc",
844 "common/hwid_override_unittest.cc",
845 "common/metrics_reporter_stub.cc",
846 "common/mock_http_fetcher.cc",
847 "common/prefs_unittest.cc",
848 "common/terminator_unittest.cc",
849 "common/test_utils.cc",
Kelvin Zhang55624032021-12-20 12:13:24 -0800850 "lz4diff/lz4diff_compress_unittest.cc",
Kelvin Zhang893b3a12021-12-30 12:28:53 -0800851 "lz4diff/lz4diff_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700852 "payload_generator/ab_generator_unittest.cc",
853 "payload_generator/blob_file_writer_unittest.cc",
854 "payload_generator/block_mapping_unittest.cc",
855 "payload_generator/boot_img_filesystem_unittest.cc",
856 "payload_generator/deflate_utils_unittest.cc",
857 "payload_generator/delta_diff_utils_unittest.cc",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800858 "payload_generator/erofs_filesystem_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700859 "payload_generator/ext2_filesystem_unittest.cc",
860 "payload_generator/extent_ranges_unittest.cc",
861 "payload_generator/extent_utils_unittest.cc",
862 "payload_generator/fake_filesystem.cc",
863 "payload_generator/full_update_generator_unittest.cc",
864 "payload_generator/mapfile_filesystem_unittest.cc",
865 "payload_generator/merge_sequence_generator_unittest.cc",
866 "payload_generator/payload_file_unittest.cc",
867 "payload_generator/payload_generation_config_android_unittest.cc",
868 "payload_generator/payload_generation_config_unittest.cc",
869 "payload_generator/payload_properties_unittest.cc",
870 "payload_generator/payload_signer_unittest.cc",
871 "payload_generator/squashfs_filesystem_unittest.cc",
872 "payload_generator/zip_unittest.cc",
Kelvin Zhange4bffe62022-03-07 09:08:38 -0800873 "payload_consumer/verity_writer_android_unittest.cc",
874 "payload_consumer/xz_extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700875 "testrunner.cc",
876 ],
877}
878
879cc_test_host {
880 name: "update_engine_host_unittests",
881 defaults: [
882 "ue_defaults",
883 "libpayload_generator_exports",
884 ],
885 strip: {
886 none: true,
887 },
888 cflags: [
889 "-g3",
890 ],
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -0800891 tidy_timeout_srcs: [":update_engine_host_unittest_timeout_srcs"],
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700892 srcs: [":update_engine_host_unittest_srcs"],
893 data: [
894 ":ue_unittest_delta_generator",
895 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -0800896 ":ue_unittest_erofs_imgs",
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700897 ":ue_unittest_keys",
898 "otacerts.zip",
899 "unittest_key.pem",
900 "unittest_key2.pem",
901 "unittest_key_RSA4096.pem",
902 "unittest_key_EC.pem",
903 "update_engine.conf",
904 ],
905 static_libs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -0700906 "libgmock",
907 "libpayload_generator",
908 ],
909}
910
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700911// update_engine_unittests (type: executable)
912// ========================================================
913// Main unittest file.
914cc_test {
Kelvin Zhang7e5b4052022-03-22 12:17:59 -0700915 name: "update_engine_http_unittests",
916 defaults: [
917 "ue_defaults",
918 "liblz4diff_defaults",
919 "update_metadata-protos_exports",
920 ],
921 require_root: true,
922 static_libs: [
923 "libbase",
924 "libbrillo-test-helpers",
925 "libchrome_test_helpers",
926 "libcurl",
927 "libcutils",
928 "libdm",
929 "libgmock",
930 "libz",
931 ],
932 shared_libs: [
933 "libssl",
934 "libcrypto",
935 "libziparchive",
936 "liblog",
937 ],
938
939 data: [
940 ":test_http_server",
941 ":test_subprocess",
942 ":ue_unittest_keys",
943 "otacerts.zip",
944 "unittest_key.pem",
945 "unittest_key2.pem",
946 "unittest_key_RSA4096.pem",
947 "unittest_key_EC.pem",
948 ],
949
950 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
951 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
952 // test_config: "test_config.xml",
953 test_suites: ["device-tests"],
954
955 srcs: [
956 "aosp/platform_constants_android.cc",
957 "certificate_checker.cc",
958 "common/action_processor.cc",
959 "common/boot_control_stub.cc",
960 "common/error_code_utils.cc",
961 "common/file_fetcher.cc",
962 "common/hash_calculator.cc",
963 "common/http_fetcher.cc",
964 "common/multi_range_http_fetcher.cc",
965 "common/http_common.cc",
966 "common/subprocess.cc",
967 "common/test_utils.cc",
968 "common/utils.cc",
969 "common/proxy_resolver.cc",
970 "libcurl_http_fetcher.cc",
971 "payload_consumer/certificate_parser_android.cc",
972 "payload_consumer/payload_verifier.cc",
973 "payload_generator/payload_signer.cc",
974 "update_status_utils.cc",
975
976 "certificate_checker_unittest.cc",
977 "common/http_fetcher_unittest.cc",
978 "common/mock_http_fetcher.cc",
979 "common/proxy_resolver_unittest.cc",
980 "common/subprocess_unittest.cc",
981 "libcurl_http_fetcher_unittest.cc",
982 "payload_consumer/certificate_parser_android_unittest.cc",
983 "update_status_utils_unittest.cc",
984 ],
985}
986
987// update_engine_unittests (type: executable)
988// ========================================================
989// Main unittest file.
990cc_test {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700991 name: "update_engine_unittests",
992 defaults: [
993 "ue_defaults",
994 "libpayload_generator_exports",
995 "libupdate_engine_android_exports",
996 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700997
998 static_libs: [
999 "libpayload_generator",
1000 "libbrillo-test-helpers",
1001 "libgmock",
1002 "libchrome_test_helpers",
1003 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -08001004 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001005 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001006
Yifan Hong87ea73f2019-09-12 13:07:37 -07001007 header_libs: [
1008 "libstorage_literals_headers",
1009 ],
1010
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001011 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -07001012 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001013 ":ue_unittest_disk_imgs",
Kelvin Zhang759e8b92021-12-21 16:46:58 -08001014 ":ue_unittest_erofs_imgs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001015 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -07001016 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001017 "unittest_key.pem",
1018 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -07001019 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -07001020 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001021 "update_engine.conf",
1022 ],
1023
Tao Bao9456b6f2019-04-29 18:14:58 -07001024 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
1025 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
1026 test_config: "test_config.xml",
1027 test_suites: ["device-tests"],
1028
Chih-Hung Hsieh85ad1472022-02-17 17:32:12 -08001029 tidy_timeout_srcs: [
1030 ":update_engine_host_unittest_timeout_srcs",
1031 "aosp/dynamic_partition_control_android_unittest.cc",
1032 "common/http_fetcher_unittest.cc",
1033 "payload_consumer/delta_performer_integration_test.cc",
1034 "payload_consumer/delta_performer_unittest.cc",
1035 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001036 srcs: [
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001037 ":update_engine_host_unittest_srcs",
Mohammad Samiul Islam24a82792021-02-12 16:52:36 +00001038 "aosp/apex_handler_android_unittest.cc",
Kelvin Zhangb4b95c22021-04-05 15:56:26 -04001039 "aosp/cleanup_previous_update_action_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001040 "aosp/dynamic_partition_control_android_unittest.cc",
Kelvin Zhang3fe49642021-10-04 15:35:02 -07001041 "aosp/update_attempter_android_integration_test.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -07001042 "aosp/update_attempter_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001043 "common/utils_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001044 "download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001045 "payload_consumer/bzip_extent_writer_unittest.cc",
1046 "payload_consumer/cached_file_descriptor_unittest.cc",
Kelvin Zhang46d6c492021-04-26 17:51:25 -04001047 "payload_consumer/cow_writer_file_descriptor_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001048 "payload_consumer/delta_performer_integration_test.cc",
1049 "payload_consumer/delta_performer_unittest.cc",
1050 "payload_consumer/extent_reader_unittest.cc",
1051 "payload_consumer/extent_writer_unittest.cc",
Kelvin Zhangc5803b72021-09-02 09:06:16 -07001052 "payload_consumer/extent_map_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001053 "payload_consumer/fake_file_descriptor.cc",
1054 "payload_consumer/file_descriptor_utils_unittest.cc",
1055 "payload_consumer/file_writer_unittest.cc",
1056 "payload_consumer/filesystem_verifier_action_unittest.cc",
Amin Hassani23795032020-11-24 14:38:55 -08001057 "payload_consumer/install_plan_unittest.cc",
Kelvin Zhang40d96662021-02-24 14:21:29 -05001058 "payload_consumer/install_operation_executor_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -07001059 "payload_consumer/partition_update_generator_android_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001060 "payload_consumer/partition_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001061 "payload_consumer/postinstall_runner_action_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001062 "payload_consumer/snapshot_extent_writer_unittest.cc",
1063 "payload_consumer/vabc_partition_writer_unittest.cc",
Kelvin Zhang4e93cf12021-09-13 16:03:24 -07001064 "payload_consumer/xor_extent_writer_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001065 ],
1066}
1067
1068// Brillo update payload generation script
1069// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001070sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001071 name: "brillo_update_payload",
1072 device_supported: false,
1073 host_supported: true,
1074
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +01001075 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -07001076 required: [
1077 "delta_generator",
1078 "shflags",
1079 "simg2img",
1080 ],
1081
1082 target: {
1083 darwin: {
1084 enabled: false,
1085 },
1086 },
Colin Cross606913a2017-11-14 13:05:37 -08001087}
Yifan Hongd51738c2020-07-23 17:06:25 -07001088
1089// update_engine header library
1090cc_library_headers {
1091 name: "libupdate_engine_headers",
Yifan Hong309c8a82020-10-06 18:31:08 -07001092
1093 // This header library is available to core and product modules.
Justin Yun6d121de2020-11-11 19:31:57 +09001094 product_available: true,
Yifan Hong309c8a82020-10-06 18:31:08 -07001095
Yifan Hongd51738c2020-07-23 17:06:25 -07001096 export_include_dirs: ["."],
1097 apex_available: [
1098 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -07001099 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -07001100 ],
David Andersonc1c93052020-08-26 18:22:09 +00001101 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -07001102 recovery_available: true,
1103 ramdisk_available: true,
1104
1105 target: {
1106 darwin: {
1107 enabled: false,
1108 },
1109 }
Yifan Hongd51738c2020-07-23 17:06:25 -07001110}
Kelvin Zhangb93055f2021-02-03 14:22:35 -05001111
1112cc_binary_host {
1113 name: "cow_converter",
1114 defaults: [
1115 "ue_defaults",
1116 "libpayload_consumer_exports",
1117 ],
1118 srcs: [
1119 "aosp/cow_converter.cc",
1120 ],
1121 static_libs: [
1122 "liblog",
1123 "libbrotli",
1124 "libbase",
1125 "libcow_operation_convert",
1126 "libcow_size_estimator",
1127 "libpayload_consumer",
1128 "libpayload_extent_ranges",
1129 "libpayload_extent_utils",
1130 "libsnapshot_cow",
1131 "libz",
1132 "update_metadata-protos",
1133 ],
Elliott Hughes88f3c8c2021-04-22 13:47:21 -07001134}
Kelvin Zhang98001b22021-12-08 14:10:11 -08001135
1136cc_library_static {
1137 name: "lz4diff-protos",
1138 host_supported: true,
1139 ramdisk_available: true,
1140 recovery_available: true,
1141
1142 srcs: ["lz4diff/lz4diff.proto"],
1143 cflags: [
1144 "-Wall",
1145 "-Werror",
1146 ],
1147 proto: {
1148 canonical_path_from_root: false,
1149 export_proto_headers: true,
1150 },
1151}
Kelvin Zhang596a3202022-03-07 14:13:42 -08001152
1153cc_binary_host {
1154 name: "ota_extractor",
1155 defaults: [
1156 "ue_defaults",
1157 "libpayload_consumer_exports",
1158 ],
1159 srcs: [
1160 "aosp/ota_extractor.cc",
1161 ],
1162 static_libs: [
1163 "liblog",
1164 "libbrotli",
1165 "libbase",
1166 "libpayload_consumer",
1167 "libpayload_extent_ranges",
1168 "libpayload_extent_utils",
1169 "libz",
1170 "libgflags",
1171 "update_metadata-protos",
1172 ],
1173}