blob: d8b89b57cf8bd893359998508542741b1321054b [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
18filegroup {
19 name: "libupdate_engine_aidl",
20 srcs: [
21 "binder_bindings/android/os/IUpdateEngine.aidl",
22 "binder_bindings/android/os/IUpdateEngineCallback.aidl",
23 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -070024 path: "binder_bindings",
25}
26
27cc_defaults {
28 name: "ue_defaults",
29
30 cflags: [
Amin Hassani2e4eda52019-01-07 14:01:17 -080031 "-DBASE_VER=576279",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070032 "-DUSE_BINDER=1",
33 "-DUSE_CHROME_NETWORK_PROXY=0",
34 "-DUSE_CHROME_KIOSK_APP=0",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070035 "-DUSE_HWID_OVERRIDE=0",
36 "-DUSE_MTD=0",
37 "-DUSE_OMAHA=0",
38 "-D_FILE_OFFSET_BITS=64",
39 "-D_POSIX_C_SOURCE=199309L",
40 "-Wa,--noexecstack",
41 "-Wall",
42 "-Werror",
43 "-Wextra",
44 "-Wformat=2",
45 "-Wno-psabi",
46 "-Wno-unused-parameter",
47 "-ffunction-sections",
48 "-fstack-protector-strong",
49 "-fvisibility=hidden",
50 ],
51 cppflags: [
52 "-Wnon-virtual-dtor",
53 "-fno-strict-aliasing",
54 ],
55 include_dirs: ["system"],
56 local_include_dirs: ["client_library/include"],
57 static_libs: ["libgtest_prod"],
58 shared_libs: [
59 "libbrillo-stream",
60 "libbrillo",
61 "libchrome",
62 ],
63 ldflags: ["-Wl,--gc-sections"],
64
65 product_variables: {
66 pdk: {
67 enabled: false,
68 },
69 },
70
71 target: {
Sen Jiangb5f631d2018-12-18 16:59:57 -080072 android: {
73 cflags: [
74 "-DUSE_FEC=1",
75 ],
76 },
77 host: {
78 cflags: [
79 "-DUSE_FEC=0",
80 ],
81 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -070082 darwin: {
83 enabled: false,
84 },
85 },
86}
87
88// update_metadata-protos (type: static_library)
89// ========================================================
90// Protobufs.
91cc_defaults {
92 name: "update_metadata-protos_exports",
93
94 shared_libs: ["libprotobuf-cpp-lite"],
95}
96
97cc_library_static {
98 name: "update_metadata-protos",
99 host_supported: true,
100 recovery_available: true,
101
102 srcs: ["update_engine/update_metadata.proto"],
103 cflags: [
104 "-Wall",
105 "-Werror",
106 ],
107 proto: {
108 canonical_path_from_root: false,
109 export_proto_headers: true,
110 },
111}
112
113// libpayload_consumer (type: static_library)
114// ========================================================
115// The payload application component and common dependencies.
116cc_defaults {
117 name: "libpayload_consumer_exports",
118 defaults: ["update_metadata-protos_exports"],
119
120 static_libs: [
121 "update_metadata-protos",
122 "libxz",
123 "libbz",
124 "libbspatch",
125 "libbrotli",
126 "libfec_rs",
127 "libpuffpatch",
128 "libverity_tree",
129 ],
130 shared_libs: [
Tianjie Xu7a78d632019-10-08 16:32:39 -0700131 "libziparchive",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700132 "libbase",
133 "libcrypto",
Sen Jiangb5f631d2018-12-18 16:59:57 -0800134 "libfec",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700135 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700136}
137
138cc_library_static {
139 name: "libpayload_consumer",
140 defaults: [
141 "ue_defaults",
142 "libpayload_consumer_exports",
143 ],
144 host_supported: true,
145 recovery_available: true,
146
147 srcs: [
148 "common/action_processor.cc",
149 "common/boot_control_stub.cc",
150 "common/clock.cc",
151 "common/constants.cc",
152 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800153 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700154 "common/error_code_utils.cc",
155 "common/file_fetcher.cc",
156 "common/hash_calculator.cc",
157 "common/http_common.cc",
158 "common/http_fetcher.cc",
159 "common/hwid_override.cc",
160 "common/multi_range_http_fetcher.cc",
161 "common/platform_constants_android.cc",
162 "common/prefs.cc",
163 "common/proxy_resolver.cc",
164 "common/subprocess.cc",
165 "common/terminator.cc",
166 "common/utils.cc",
167 "payload_consumer/bzip_extent_writer.cc",
168 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700169 "payload_consumer/certificate_parser_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700170 "payload_consumer/delta_performer.cc",
171 "payload_consumer/download_action.cc",
172 "payload_consumer/extent_reader.cc",
173 "payload_consumer/extent_writer.cc",
174 "payload_consumer/file_descriptor.cc",
175 "payload_consumer/file_descriptor_utils.cc",
176 "payload_consumer/file_writer.cc",
177 "payload_consumer/filesystem_verifier_action.cc",
178 "payload_consumer/install_plan.cc",
179 "payload_consumer/mount_history.cc",
180 "payload_consumer/payload_constants.cc",
181 "payload_consumer/payload_metadata.cc",
182 "payload_consumer/payload_verifier.cc",
183 "payload_consumer/postinstall_runner_action.cc",
184 "payload_consumer/verity_writer_android.cc",
185 "payload_consumer/xz_extent_writer.cc",
186 "payload_consumer/fec_file_descriptor.cc",
187 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700188}
189
190// libupdate_engine_boot_control (type: static_library)
191// ========================================================
192// A BootControl class implementation using Android's HIDL boot_control HAL.
193cc_defaults {
194 name: "libupdate_engine_boot_control_exports",
195 defaults: ["update_metadata-protos_exports"],
196
Yifan Hong420db9b2019-07-23 20:50:33 -0700197 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800198 "libcutils",
199 "libfs_mgr_binder",
200 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800201 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700202 "libsnapshot",
203 "update_metadata-protos",
204 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700205 shared_libs: [
206 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700207 "libhidlbase",
208 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800209 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700210 "libutils",
211 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700212 "android.hardware.boot@1.1",
Yifan Hong212d7952020-02-04 11:08:08 -0800213
214 //TODO(b/148818798): remove when parent bug fixed
215 "libutilscallstack",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700216 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700217 target: {
218 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800219 static_libs: [
220 "libfs_mgr",
221 "libsnapshot_nobinder",
222 ],
223 exclude_static_libs: [
224 "libfs_mgr_binder",
225 "libsnapshot",
226 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800227 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800228 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800229 "libutilscallstack",
230 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700231 },
232 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700233}
234
235cc_library_static {
236 name: "libupdate_engine_boot_control",
237 defaults: [
238 "ue_defaults",
239 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800240 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700241 ],
242 recovery_available: true,
243
244 srcs: [
245 "boot_control_android.cc",
Yifan Hongdad0af82020-02-19 17:19:49 -0800246 "cleanup_previous_update_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700247 "dynamic_partition_control_android.cc",
Yifan Hong012508e2019-07-22 18:30:40 -0700248 "dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700249 ],
250}
251
252// libupdate_engine_android (type: static_library)
253// ========================================================
254// The main daemon static_library used in Android (non-Brillo). This only has a
255// loop to apply payloads provided by the upper layer via a Binder interface.
256cc_defaults {
257 name: "libupdate_engine_android_exports",
258 defaults: [
259 "ue_defaults",
260 "libpayload_consumer_exports",
261 "libupdate_engine_boot_control_exports",
262 ],
263
264 static_libs: [
265 "libpayload_consumer",
266 "libupdate_engine_boot_control",
267 ],
268 shared_libs: [
269 "libandroid_net",
270 "libbase",
271 "libbinder",
272 "libbinderwrapper",
273 "libbootloader_message",
274 "libbrillo-binder",
275 "libcurl",
276 "libcutils",
277 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700278 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700279 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700280 "libutils",
281 ],
282}
283
284cc_library_static {
285 name: "libupdate_engine_android",
286 defaults: [
287 "ue_defaults",
288 "libupdate_engine_android_exports",
289 ],
290
291 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
292 // out of the DBus interface.
293 include_dirs: ["external/cros/system_api/dbus"],
294
295 aidl: {
296 local_include_dirs: ["binder_bindings"],
297 export_aidl_headers: true,
298 },
299
300 srcs: [
301 ":libupdate_engine_aidl",
302 "binder_service_android.cc",
303 "certificate_checker.cc",
304 "daemon.cc",
305 "daemon_state_android.cc",
306 "hardware_android.cc",
307 "libcurl_http_fetcher.cc",
Yifan Hongc80de2d2020-02-25 17:13:53 -0800308 "logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700309 "metrics_reporter_android.cc",
310 "metrics_utils.cc",
311 "network_selector_android.cc",
312 "update_attempter_android.cc",
313 "update_boot_flags_action.cc",
314 "update_status_utils.cc",
315 ],
316}
317
318// update_engine (type: executable)
319// ========================================================
320// update_engine daemon.
321cc_binary {
322 name: "update_engine",
323 defaults: [
324 "ue_defaults",
325 "libupdate_engine_android_exports",
326 ],
327
328 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700329 required: [
330 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700331 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700332 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700333
334 srcs: ["main.cc"],
335 init_rc: ["update_engine.rc"],
336}
337
338// update_engine_sideload (type: executable)
339// ========================================================
340// A binary executable equivalent to update_engine daemon that installs an update
341// from a local file directly instead of running in the background. Used in
342// recovery image.
343cc_binary {
344 name: "update_engine_sideload",
345 defaults: [
346 "ue_defaults",
347 "update_metadata-protos_exports",
348 "libupdate_engine_boot_control_exports",
349 "libpayload_consumer_exports",
350 ],
351 recovery: true,
352
353 cflags: ["-D_UE_SIDELOAD"],
354 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
355 // out of the DBus interface.
356 include_dirs: ["external/cros/system_api/dbus"],
357
358 srcs: [
359 "hardware_android.cc",
360 "metrics_reporter_stub.cc",
361 "metrics_utils.cc",
362 "network_selector_stub.cc",
Yifan Hongc73cb8c2019-10-24 18:28:31 -0700363 "sideload_logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700364 "sideload_main.cc",
365 "update_attempter_android.cc",
366 "update_boot_flags_action.cc",
367 "update_status_utils.cc",
368 ],
369
370 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
371 // as it doesn't look beneficial to be installed separately due to its size. Note
372 // that we explicitly request their recovery variants, so that the expected files
373 // will be used and installed.
374 shared_libs: [
375 "libbase",
376 "liblog",
377 ],
378 static_libs: [
379 "libpayload_consumer",
380 "libupdate_engine_boot_control",
381 "update_metadata-protos",
382
383 // We add the static versions of the shared libraries that are not installed to
384 // recovery image due to size concerns. Need to include all the static library
385 // dependencies of these static libraries.
386 "libevent",
387 "libmodpb64",
388 "libgtest_prod",
389 "libprotobuf-cpp-lite",
390 "libbrillo-stream",
391 "libbrillo",
392 "libchrome",
393 ],
394 target: {
395 recovery: {
396 exclude_shared_libs: [
397 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700398 "libbrillo-stream",
399 "libbrillo",
400 "libchrome",
401 ],
402 },
403 },
404
Tao Bao1e1c86c2019-04-18 10:48:32 -0700405 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700406 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700407 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700408}
409
410// libupdate_engine_client (type: shared_library)
411// ========================================================
412cc_library_shared {
413 name: "libupdate_engine_client",
414
415 cflags: [
416 "-Wall",
417 "-Werror",
418 "-Wno-unused-parameter",
419 "-DUSE_BINDER=1",
420 ],
421 export_include_dirs: ["client_library/include"],
422 include_dirs: [
423 // TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used.
424 "external/cros/system_api/dbus",
425 "system",
426 ],
427
428 aidl: {
429 local_include_dirs: ["binder_bindings"],
430 },
431
432 shared_libs: [
433 "libchrome",
434 "libbrillo",
435 "libbinder",
436 "libbrillo-binder",
437 "libutils",
438 ],
439
440 srcs: [
Dan Willemsen3c7e4b62019-06-06 14:56:15 -0700441 ":libupdate_engine_client_aidl",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700442 "client_library/client.cc",
443 "client_library/client_binder.cc",
444 "parcelable_update_engine_status.cc",
445 "update_status_utils.cc",
446 ],
447}
448
Dan Willemsen3c7e4b62019-06-06 14:56:15 -0700449filegroup {
450 name: "libupdate_engine_client_aidl",
451 srcs: [
452 "binder_bindings/android/brillo/IUpdateEngine.aidl",
453 "binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl",
454 ],
455 path: "binder_bindings",
456}
457
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700458// update_engine_client (type: executable)
459// ========================================================
460// update_engine console client.
461cc_binary {
462 name: "update_engine_client",
463 defaults: ["ue_defaults"],
464
465 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
466 // out of the DBus interface.
467 include_dirs: ["external/cros/system_api/dbus"],
468
469 shared_libs: [
470 "libbinder",
471 "libbinderwrapper",
472 "libbrillo-binder",
473 "libutils",
474 ],
475
476 aidl: {
477 local_include_dirs: ["binder_bindings"],
478 },
479
480 srcs: [
481 ":libupdate_engine_aidl",
482 "common/error_code_utils.cc",
483 "update_engine_client_android.cc",
484 "update_status_utils.cc",
485 ],
486}
487
488// libpayload_generator (type: static_library)
489// ========================================================
490// server-side code. This is used for delta_generator and unittests but not
491// for any client code.
492cc_defaults {
493 name: "libpayload_generator_exports",
494 defaults: [
495 "libpayload_consumer_exports",
496 "update_metadata-protos_exports",
497 ],
498
499 static_libs: [
500 "libavb",
501 "libbrotli",
502 "libbsdiff",
503 "libdivsufsort",
504 "libdivsufsort64",
505 "liblzma",
506 "libpayload_consumer",
507 "libpuffdiff",
508 "libverity_tree",
509 "update_metadata-protos",
510 ],
511 shared_libs: [
512 "libbase",
513 "libext2fs",
514 ],
515}
516
517cc_library_static {
518 name: "libpayload_generator",
519 defaults: [
520 "ue_defaults",
521 "libpayload_generator_exports",
522 ],
523 host_supported: true,
524
525 srcs: [
526 "payload_generator/ab_generator.cc",
527 "payload_generator/annotated_operation.cc",
528 "payload_generator/blob_file_writer.cc",
529 "payload_generator/block_mapping.cc",
530 "payload_generator/boot_img_filesystem.cc",
531 "payload_generator/bzip.cc",
532 "payload_generator/cycle_breaker.cc",
533 "payload_generator/deflate_utils.cc",
534 "payload_generator/delta_diff_generator.cc",
535 "payload_generator/delta_diff_utils.cc",
536 "payload_generator/ext2_filesystem.cc",
537 "payload_generator/extent_ranges.cc",
538 "payload_generator/extent_utils.cc",
539 "payload_generator/full_update_generator.cc",
540 "payload_generator/graph_types.cc",
541 "payload_generator/graph_utils.cc",
542 "payload_generator/inplace_generator.cc",
543 "payload_generator/mapfile_filesystem.cc",
544 "payload_generator/payload_file.cc",
545 "payload_generator/payload_generation_config_android.cc",
546 "payload_generator/payload_generation_config.cc",
547 "payload_generator/payload_signer.cc",
548 "payload_generator/raw_filesystem.cc",
549 "payload_generator/squashfs_filesystem.cc",
550 "payload_generator/tarjan.cc",
551 "payload_generator/topological_sort.cc",
552 "payload_generator/xz_android.cc",
553 ],
554}
555
556// delta_generator (type: executable)
557// ========================================================
558// server-side delta generator.
559cc_binary_host {
560 name: "delta_generator",
561 defaults: [
562 "ue_defaults",
563 "libpayload_generator_exports",
564 "libpayload_consumer_exports",
565 ],
566
567 static_libs: [
568 "libavb_host_sysdeps",
569 "libpayload_consumer",
570 "libpayload_generator",
571 ],
572
573 srcs: ["payload_generator/generate_delta_main.cc"],
574}
575
576cc_test {
577 name: "ue_unittest_delta_generator",
578 defaults: [
579 "ue_defaults",
580 "libpayload_generator_exports",
581 "libpayload_consumer_exports",
582 ],
583
584 static_libs: [
585 "libpayload_consumer",
586 "libpayload_generator",
587 ],
588
589 srcs: ["payload_generator/generate_delta_main.cc"],
590
591 gtest: false,
592 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700593}
594
595// test_http_server (type: executable)
596// ========================================================
597// Test HTTP Server.
598cc_test {
599 name: "test_http_server",
600 defaults: ["ue_defaults"],
601 srcs: [
602 "common/http_common.cc",
603 "test_http_server.cc",
604 ],
605
606 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700607}
608
609// test_subprocess (type: executable)
610// ========================================================
611// Test helper subprocess program.
612cc_test {
613 name: "test_subprocess",
614 defaults: ["ue_defaults"],
615 srcs: ["test_subprocess.cc"],
616
617 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700618}
619
620// Public keys for unittests.
621// ========================================================
622genrule {
623 name: "ue_unittest_keys",
624 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700625 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700626 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
627 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700628 srcs: [
629 "unittest_key.pem",
630 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700631 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700632 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700633 ],
634 out: [
635 "unittest_key.pub.pem",
636 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700637 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700638 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700639 ],
640}
641
642// Sample images for unittests.
643// ========================================================
644// Extract sample image from the compressed sample_images.tar.bz2 file used by
645// the unittests.
646genrule {
647 name: "ue_unittest_disk_imgs",
648 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
649 srcs: ["sample_images/sample_images.tar.bz2"],
650 out: [
651 "gen/disk_ext2_1k.img",
652 "gen/disk_ext2_4k.img",
653 "gen/disk_ext2_4k_empty.img",
654 "gen/disk_ext2_unittest.img",
655 ],
656}
657
658// update_engine_unittests (type: executable)
659// ========================================================
660// Main unittest file.
661cc_test {
662 name: "update_engine_unittests",
663 defaults: [
664 "ue_defaults",
665 "libpayload_generator_exports",
666 "libupdate_engine_android_exports",
667 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700668
669 static_libs: [
670 "libpayload_generator",
671 "libbrillo-test-helpers",
672 "libgmock",
673 "libchrome_test_helpers",
674 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -0800675 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700676 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700677
Yifan Hong87ea73f2019-09-12 13:07:37 -0700678 header_libs: [
679 "libstorage_literals_headers",
680 ],
681
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700682 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -0700683 ":test_http_server",
684 ":test_subprocess",
685 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700686 ":ue_unittest_disk_imgs",
687 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700688 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700689 "unittest_key.pem",
690 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700691 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700692 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700693 "update_engine.conf",
694 ],
695
Tao Bao9456b6f2019-04-29 18:14:58 -0700696 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
697 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
698 test_config: "test_config.xml",
699 test_suites: ["device-tests"],
700
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700701 srcs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700702 "certificate_checker_unittest.cc",
703 "common/action_pipe_unittest.cc",
704 "common/action_processor_unittest.cc",
705 "common/action_unittest.cc",
706 "common/cpu_limiter_unittest.cc",
707 "common/fake_prefs.cc",
708 "common/file_fetcher_unittest.cc",
709 "common/hash_calculator_unittest.cc",
710 "common/http_fetcher_unittest.cc",
711 "common/hwid_override_unittest.cc",
712 "common/mock_http_fetcher.cc",
713 "common/prefs_unittest.cc",
714 "common/proxy_resolver_unittest.cc",
715 "common/subprocess_unittest.cc",
716 "common/terminator_unittest.cc",
717 "common/test_utils.cc",
718 "common/utils_unittest.cc",
Yifan Hongc049f932019-07-23 15:06:05 -0700719 "dynamic_partition_control_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700720 "payload_consumer/bzip_extent_writer_unittest.cc",
721 "payload_consumer/cached_file_descriptor_unittest.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700722 "payload_consumer/certificate_parser_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700723 "payload_consumer/delta_performer_integration_test.cc",
724 "payload_consumer/delta_performer_unittest.cc",
725 "payload_consumer/extent_reader_unittest.cc",
726 "payload_consumer/extent_writer_unittest.cc",
727 "payload_consumer/fake_file_descriptor.cc",
728 "payload_consumer/file_descriptor_utils_unittest.cc",
729 "payload_consumer/file_writer_unittest.cc",
730 "payload_consumer/filesystem_verifier_action_unittest.cc",
731 "payload_consumer/postinstall_runner_action_unittest.cc",
732 "payload_consumer/verity_writer_android_unittest.cc",
733 "payload_consumer/xz_extent_writer_unittest.cc",
734 "payload_generator/ab_generator_unittest.cc",
735 "payload_generator/blob_file_writer_unittest.cc",
736 "payload_generator/block_mapping_unittest.cc",
737 "payload_generator/boot_img_filesystem_unittest.cc",
738 "payload_generator/cycle_breaker_unittest.cc",
739 "payload_generator/deflate_utils_unittest.cc",
740 "payload_generator/delta_diff_utils_unittest.cc",
741 "payload_generator/ext2_filesystem_unittest.cc",
742 "payload_generator/extent_ranges_unittest.cc",
743 "payload_generator/extent_utils_unittest.cc",
744 "payload_generator/fake_filesystem.cc",
745 "payload_generator/full_update_generator_unittest.cc",
746 "payload_generator/graph_utils_unittest.cc",
747 "payload_generator/inplace_generator_unittest.cc",
748 "payload_generator/mapfile_filesystem_unittest.cc",
749 "payload_generator/payload_file_unittest.cc",
750 "payload_generator/payload_generation_config_android_unittest.cc",
751 "payload_generator/payload_generation_config_unittest.cc",
752 "payload_generator/payload_signer_unittest.cc",
753 "payload_generator/squashfs_filesystem_unittest.cc",
754 "payload_generator/tarjan_unittest.cc",
755 "payload_generator/topological_sort_unittest.cc",
756 "payload_generator/zip_unittest.cc",
757 "testrunner.cc",
758 "update_attempter_android_unittest.cc",
759 ],
760}
761
762// Brillo update payload generation script
763// ========================================================
764cc_prebuilt_binary {
765 name: "brillo_update_payload",
766 device_supported: false,
767 host_supported: true,
768
769 srcs: ["scripts/brillo_update_payload"],
770 required: [
771 "delta_generator",
772 "shflags",
773 "simg2img",
774 ],
775
776 target: {
777 darwin: {
778 enabled: false,
779 },
780 },
Colin Cross606913a2017-11-14 13:05:37 -0800781}
Ralph Nathanab8026c2018-08-08 15:43:02 -0700782
783// AIDL interface between libupdate_engine and the Things jar.
784filegroup {
785 name: "things_update_engine_aidl",
786 srcs: [
787 "binder_bindings/android/brillo/IUpdateEngine.aidl",
788 "binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl",
789 ],
790}