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