blob: 07eee639b31f89704ed35e325a37303341b9581c [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",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700213 ],
Yifan Hong29692902020-03-26 12:47:05 -0700214 header_libs: [
215 "avb_headers",
216 ],
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 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700230 },
231 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700232}
233
234cc_library_static {
235 name: "libupdate_engine_boot_control",
236 defaults: [
237 "ue_defaults",
238 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800239 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700240 ],
241 recovery_available: true,
242
243 srcs: [
244 "boot_control_android.cc",
Yifan Hongdad0af82020-02-19 17:19:49 -0800245 "cleanup_previous_update_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700246 "dynamic_partition_control_android.cc",
Yifan Hong012508e2019-07-22 18:30:40 -0700247 "dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700248 ],
249}
250
251// libupdate_engine_android (type: static_library)
252// ========================================================
253// The main daemon static_library used in Android (non-Brillo). This only has a
254// loop to apply payloads provided by the upper layer via a Binder interface.
255cc_defaults {
256 name: "libupdate_engine_android_exports",
257 defaults: [
258 "ue_defaults",
259 "libpayload_consumer_exports",
260 "libupdate_engine_boot_control_exports",
261 ],
262
263 static_libs: [
264 "libpayload_consumer",
265 "libupdate_engine_boot_control",
266 ],
267 shared_libs: [
268 "libandroid_net",
269 "libbase",
270 "libbinder",
271 "libbinderwrapper",
272 "libbootloader_message",
273 "libbrillo-binder",
274 "libcurl",
275 "libcutils",
276 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700277 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700278 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700279 "libutils",
280 ],
281}
282
283cc_library_static {
284 name: "libupdate_engine_android",
285 defaults: [
286 "ue_defaults",
287 "libupdate_engine_android_exports",
288 ],
289
290 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
291 // out of the DBus interface.
292 include_dirs: ["external/cros/system_api/dbus"],
293
294 aidl: {
295 local_include_dirs: ["binder_bindings"],
296 export_aidl_headers: true,
297 },
298
299 srcs: [
300 ":libupdate_engine_aidl",
301 "binder_service_android.cc",
302 "certificate_checker.cc",
303 "daemon.cc",
304 "daemon_state_android.cc",
305 "hardware_android.cc",
306 "libcurl_http_fetcher.cc",
Yifan Hongc80de2d2020-02-25 17:13:53 -0800307 "logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700308 "metrics_reporter_android.cc",
309 "metrics_utils.cc",
310 "network_selector_android.cc",
311 "update_attempter_android.cc",
312 "update_boot_flags_action.cc",
313 "update_status_utils.cc",
314 ],
315}
316
317// update_engine (type: executable)
318// ========================================================
319// update_engine daemon.
320cc_binary {
321 name: "update_engine",
322 defaults: [
323 "ue_defaults",
324 "libupdate_engine_android_exports",
325 ],
326
327 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700328 required: [
329 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700330 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700331 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700332
333 srcs: ["main.cc"],
334 init_rc: ["update_engine.rc"],
335}
336
337// update_engine_sideload (type: executable)
338// ========================================================
339// A binary executable equivalent to update_engine daemon that installs an update
340// from a local file directly instead of running in the background. Used in
341// recovery image.
342cc_binary {
343 name: "update_engine_sideload",
344 defaults: [
345 "ue_defaults",
346 "update_metadata-protos_exports",
347 "libupdate_engine_boot_control_exports",
348 "libpayload_consumer_exports",
349 ],
350 recovery: true,
351
352 cflags: ["-D_UE_SIDELOAD"],
353 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
354 // out of the DBus interface.
355 include_dirs: ["external/cros/system_api/dbus"],
356
357 srcs: [
358 "hardware_android.cc",
359 "metrics_reporter_stub.cc",
360 "metrics_utils.cc",
361 "network_selector_stub.cc",
Yifan Hongc73cb8c2019-10-24 18:28:31 -0700362 "sideload_logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700363 "sideload_main.cc",
364 "update_attempter_android.cc",
365 "update_boot_flags_action.cc",
366 "update_status_utils.cc",
367 ],
368
369 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
370 // as it doesn't look beneficial to be installed separately due to its size. Note
371 // that we explicitly request their recovery variants, so that the expected files
372 // will be used and installed.
373 shared_libs: [
374 "libbase",
375 "liblog",
376 ],
377 static_libs: [
378 "libpayload_consumer",
379 "libupdate_engine_boot_control",
380 "update_metadata-protos",
381
382 // We add the static versions of the shared libraries that are not installed to
383 // recovery image due to size concerns. Need to include all the static library
384 // dependencies of these static libraries.
385 "libevent",
386 "libmodpb64",
387 "libgtest_prod",
388 "libprotobuf-cpp-lite",
389 "libbrillo-stream",
390 "libbrillo",
391 "libchrome",
392 ],
393 target: {
394 recovery: {
395 exclude_shared_libs: [
396 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700397 "libbrillo-stream",
398 "libbrillo",
399 "libchrome",
400 ],
401 },
402 },
403
Tao Bao1e1c86c2019-04-18 10:48:32 -0700404 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700405 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700406 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700407}
408
409// libupdate_engine_client (type: shared_library)
410// ========================================================
411cc_library_shared {
412 name: "libupdate_engine_client",
413
414 cflags: [
415 "-Wall",
416 "-Werror",
417 "-Wno-unused-parameter",
418 "-DUSE_BINDER=1",
419 ],
420 export_include_dirs: ["client_library/include"],
421 include_dirs: [
422 // TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used.
423 "external/cros/system_api/dbus",
424 "system",
425 ],
426
427 aidl: {
428 local_include_dirs: ["binder_bindings"],
429 },
430
431 shared_libs: [
432 "libchrome",
433 "libbrillo",
434 "libbinder",
435 "libbrillo-binder",
436 "libutils",
437 ],
438
439 srcs: [
Dan Willemsen3c7e4b62019-06-06 14:56:15 -0700440 ":libupdate_engine_client_aidl",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700441 "client_library/client.cc",
442 "client_library/client_binder.cc",
443 "parcelable_update_engine_status.cc",
444 "update_status_utils.cc",
445 ],
446}
447
Dan Willemsen3c7e4b62019-06-06 14:56:15 -0700448filegroup {
449 name: "libupdate_engine_client_aidl",
450 srcs: [
451 "binder_bindings/android/brillo/IUpdateEngine.aidl",
452 "binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl",
453 ],
454 path: "binder_bindings",
455}
456
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700457// update_engine_client (type: executable)
458// ========================================================
459// update_engine console client.
460cc_binary {
461 name: "update_engine_client",
462 defaults: ["ue_defaults"],
463
464 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
465 // out of the DBus interface.
466 include_dirs: ["external/cros/system_api/dbus"],
467
468 shared_libs: [
469 "libbinder",
470 "libbinderwrapper",
471 "libbrillo-binder",
472 "libutils",
473 ],
474
475 aidl: {
476 local_include_dirs: ["binder_bindings"],
477 },
478
479 srcs: [
480 ":libupdate_engine_aidl",
481 "common/error_code_utils.cc",
482 "update_engine_client_android.cc",
483 "update_status_utils.cc",
484 ],
485}
486
487// libpayload_generator (type: static_library)
488// ========================================================
489// server-side code. This is used for delta_generator and unittests but not
490// for any client code.
491cc_defaults {
492 name: "libpayload_generator_exports",
493 defaults: [
494 "libpayload_consumer_exports",
495 "update_metadata-protos_exports",
496 ],
497
Tianjie37ae8562020-03-25 15:16:01 -0700498 header_libs: [
499 "bootimg_headers",
500 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700501 static_libs: [
502 "libavb",
503 "libbrotli",
504 "libbsdiff",
505 "libdivsufsort",
506 "libdivsufsort64",
507 "liblzma",
508 "libpayload_consumer",
509 "libpuffdiff",
510 "libverity_tree",
511 "update_metadata-protos",
512 ],
513 shared_libs: [
514 "libbase",
515 "libext2fs",
516 ],
517}
518
519cc_library_static {
520 name: "libpayload_generator",
521 defaults: [
522 "ue_defaults",
523 "libpayload_generator_exports",
524 ],
525 host_supported: true,
526
527 srcs: [
528 "payload_generator/ab_generator.cc",
529 "payload_generator/annotated_operation.cc",
530 "payload_generator/blob_file_writer.cc",
531 "payload_generator/block_mapping.cc",
532 "payload_generator/boot_img_filesystem.cc",
533 "payload_generator/bzip.cc",
534 "payload_generator/cycle_breaker.cc",
535 "payload_generator/deflate_utils.cc",
536 "payload_generator/delta_diff_generator.cc",
537 "payload_generator/delta_diff_utils.cc",
538 "payload_generator/ext2_filesystem.cc",
539 "payload_generator/extent_ranges.cc",
540 "payload_generator/extent_utils.cc",
541 "payload_generator/full_update_generator.cc",
542 "payload_generator/graph_types.cc",
543 "payload_generator/graph_utils.cc",
544 "payload_generator/inplace_generator.cc",
545 "payload_generator/mapfile_filesystem.cc",
546 "payload_generator/payload_file.cc",
547 "payload_generator/payload_generation_config_android.cc",
548 "payload_generator/payload_generation_config.cc",
549 "payload_generator/payload_signer.cc",
550 "payload_generator/raw_filesystem.cc",
551 "payload_generator/squashfs_filesystem.cc",
552 "payload_generator/tarjan.cc",
553 "payload_generator/topological_sort.cc",
554 "payload_generator/xz_android.cc",
555 ],
556}
557
558// delta_generator (type: executable)
559// ========================================================
560// server-side delta generator.
561cc_binary_host {
562 name: "delta_generator",
563 defaults: [
564 "ue_defaults",
565 "libpayload_generator_exports",
566 "libpayload_consumer_exports",
567 ],
568
569 static_libs: [
570 "libavb_host_sysdeps",
571 "libpayload_consumer",
572 "libpayload_generator",
573 ],
574
575 srcs: ["payload_generator/generate_delta_main.cc"],
576}
577
578cc_test {
579 name: "ue_unittest_delta_generator",
580 defaults: [
581 "ue_defaults",
582 "libpayload_generator_exports",
583 "libpayload_consumer_exports",
584 ],
585
586 static_libs: [
587 "libpayload_consumer",
588 "libpayload_generator",
589 ],
590
591 srcs: ["payload_generator/generate_delta_main.cc"],
592
593 gtest: false,
594 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700595}
596
597// test_http_server (type: executable)
598// ========================================================
599// Test HTTP Server.
600cc_test {
601 name: "test_http_server",
602 defaults: ["ue_defaults"],
603 srcs: [
604 "common/http_common.cc",
605 "test_http_server.cc",
606 ],
607
608 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700609}
610
611// test_subprocess (type: executable)
612// ========================================================
613// Test helper subprocess program.
614cc_test {
615 name: "test_subprocess",
616 defaults: ["ue_defaults"],
617 srcs: ["test_subprocess.cc"],
618
619 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700620}
621
622// Public keys for unittests.
623// ========================================================
624genrule {
625 name: "ue_unittest_keys",
626 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700627 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700628 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
629 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700630 srcs: [
631 "unittest_key.pem",
632 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700633 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700634 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700635 ],
636 out: [
637 "unittest_key.pub.pem",
638 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700639 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700640 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700641 ],
642}
643
644// Sample images for unittests.
645// ========================================================
646// Extract sample image from the compressed sample_images.tar.bz2 file used by
647// the unittests.
648genrule {
649 name: "ue_unittest_disk_imgs",
650 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
651 srcs: ["sample_images/sample_images.tar.bz2"],
652 out: [
653 "gen/disk_ext2_1k.img",
654 "gen/disk_ext2_4k.img",
655 "gen/disk_ext2_4k_empty.img",
656 "gen/disk_ext2_unittest.img",
657 ],
658}
659
660// update_engine_unittests (type: executable)
661// ========================================================
662// Main unittest file.
663cc_test {
664 name: "update_engine_unittests",
665 defaults: [
666 "ue_defaults",
667 "libpayload_generator_exports",
668 "libupdate_engine_android_exports",
669 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700670
671 static_libs: [
672 "libpayload_generator",
673 "libbrillo-test-helpers",
674 "libgmock",
675 "libchrome_test_helpers",
676 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -0800677 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700678 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700679
Yifan Hong87ea73f2019-09-12 13:07:37 -0700680 header_libs: [
681 "libstorage_literals_headers",
682 ],
683
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700684 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -0700685 ":test_http_server",
686 ":test_subprocess",
687 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700688 ":ue_unittest_disk_imgs",
689 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700690 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700691 "unittest_key.pem",
692 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700693 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700694 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700695 "update_engine.conf",
696 ],
697
Tao Bao9456b6f2019-04-29 18:14:58 -0700698 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
699 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
700 test_config: "test_config.xml",
701 test_suites: ["device-tests"],
702
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700703 srcs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700704 "certificate_checker_unittest.cc",
705 "common/action_pipe_unittest.cc",
706 "common/action_processor_unittest.cc",
707 "common/action_unittest.cc",
708 "common/cpu_limiter_unittest.cc",
709 "common/fake_prefs.cc",
710 "common/file_fetcher_unittest.cc",
711 "common/hash_calculator_unittest.cc",
712 "common/http_fetcher_unittest.cc",
713 "common/hwid_override_unittest.cc",
714 "common/mock_http_fetcher.cc",
715 "common/prefs_unittest.cc",
716 "common/proxy_resolver_unittest.cc",
717 "common/subprocess_unittest.cc",
718 "common/terminator_unittest.cc",
719 "common/test_utils.cc",
720 "common/utils_unittest.cc",
Yifan Hongc049f932019-07-23 15:06:05 -0700721 "dynamic_partition_control_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700722 "payload_consumer/bzip_extent_writer_unittest.cc",
723 "payload_consumer/cached_file_descriptor_unittest.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700724 "payload_consumer/certificate_parser_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700725 "payload_consumer/delta_performer_integration_test.cc",
726 "payload_consumer/delta_performer_unittest.cc",
727 "payload_consumer/extent_reader_unittest.cc",
728 "payload_consumer/extent_writer_unittest.cc",
729 "payload_consumer/fake_file_descriptor.cc",
730 "payload_consumer/file_descriptor_utils_unittest.cc",
731 "payload_consumer/file_writer_unittest.cc",
732 "payload_consumer/filesystem_verifier_action_unittest.cc",
733 "payload_consumer/postinstall_runner_action_unittest.cc",
734 "payload_consumer/verity_writer_android_unittest.cc",
735 "payload_consumer/xz_extent_writer_unittest.cc",
736 "payload_generator/ab_generator_unittest.cc",
737 "payload_generator/blob_file_writer_unittest.cc",
738 "payload_generator/block_mapping_unittest.cc",
739 "payload_generator/boot_img_filesystem_unittest.cc",
740 "payload_generator/cycle_breaker_unittest.cc",
741 "payload_generator/deflate_utils_unittest.cc",
742 "payload_generator/delta_diff_utils_unittest.cc",
743 "payload_generator/ext2_filesystem_unittest.cc",
744 "payload_generator/extent_ranges_unittest.cc",
745 "payload_generator/extent_utils_unittest.cc",
746 "payload_generator/fake_filesystem.cc",
747 "payload_generator/full_update_generator_unittest.cc",
748 "payload_generator/graph_utils_unittest.cc",
749 "payload_generator/inplace_generator_unittest.cc",
750 "payload_generator/mapfile_filesystem_unittest.cc",
751 "payload_generator/payload_file_unittest.cc",
752 "payload_generator/payload_generation_config_android_unittest.cc",
753 "payload_generator/payload_generation_config_unittest.cc",
754 "payload_generator/payload_signer_unittest.cc",
755 "payload_generator/squashfs_filesystem_unittest.cc",
756 "payload_generator/tarjan_unittest.cc",
757 "payload_generator/topological_sort_unittest.cc",
758 "payload_generator/zip_unittest.cc",
759 "testrunner.cc",
760 "update_attempter_android_unittest.cc",
761 ],
762}
763
764// Brillo update payload generation script
765// ========================================================
766cc_prebuilt_binary {
767 name: "brillo_update_payload",
768 device_supported: false,
769 host_supported: true,
770
771 srcs: ["scripts/brillo_update_payload"],
772 required: [
773 "delta_generator",
774 "shflags",
775 "simg2img",
776 ],
777
778 target: {
779 darwin: {
780 enabled: false,
781 },
782 },
Colin Cross606913a2017-11-14 13:05:37 -0800783}
Ralph Nathanab8026c2018-08-08 15:43:02 -0700784
785// AIDL interface between libupdate_engine and the Things jar.
786filegroup {
787 name: "things_update_engine_aidl",
788 srcs: [
789 "binder_bindings/android/brillo/IUpdateEngine.aidl",
790 "binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl",
791 ],
792}