blob: 1076c526fe73c4fc4bea6e3a4c8034c0e44e05ec [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_CHROME_NETWORK_PROXY=0",
33 "-DUSE_CHROME_KIOSK_APP=0",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070034 "-DUSE_HWID_OVERRIDE=0",
Dan Willemsenf5a904e2018-10-23 01:02:44 -070035 "-D_FILE_OFFSET_BITS=64",
36 "-D_POSIX_C_SOURCE=199309L",
37 "-Wa,--noexecstack",
38 "-Wall",
39 "-Werror",
40 "-Wextra",
41 "-Wformat=2",
42 "-Wno-psabi",
43 "-Wno-unused-parameter",
44 "-ffunction-sections",
45 "-fstack-protector-strong",
46 "-fvisibility=hidden",
47 ],
48 cppflags: [
49 "-Wnon-virtual-dtor",
50 "-fno-strict-aliasing",
51 ],
52 include_dirs: ["system"],
53 local_include_dirs: ["client_library/include"],
54 static_libs: ["libgtest_prod"],
55 shared_libs: [
56 "libbrillo-stream",
57 "libbrillo",
58 "libchrome",
59 ],
60 ldflags: ["-Wl,--gc-sections"],
61
62 product_variables: {
63 pdk: {
64 enabled: false,
65 },
66 },
67
68 target: {
Sen Jiangb5f631d2018-12-18 16:59:57 -080069 android: {
70 cflags: [
71 "-DUSE_FEC=1",
72 ],
73 },
74 host: {
75 cflags: [
76 "-DUSE_FEC=0",
77 ],
78 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -070079 darwin: {
80 enabled: false,
81 },
82 },
83}
84
85// update_metadata-protos (type: static_library)
86// ========================================================
87// Protobufs.
88cc_defaults {
89 name: "update_metadata-protos_exports",
90
91 shared_libs: ["libprotobuf-cpp-lite"],
92}
93
94cc_library_static {
95 name: "update_metadata-protos",
96 host_supported: true,
97 recovery_available: true,
98
99 srcs: ["update_engine/update_metadata.proto"],
100 cflags: [
101 "-Wall",
102 "-Werror",
103 ],
104 proto: {
105 canonical_path_from_root: false,
106 export_proto_headers: true,
107 },
108}
109
110// libpayload_consumer (type: static_library)
111// ========================================================
112// The payload application component and common dependencies.
113cc_defaults {
114 name: "libpayload_consumer_exports",
115 defaults: ["update_metadata-protos_exports"],
116
117 static_libs: [
118 "update_metadata-protos",
119 "libxz",
120 "libbz",
121 "libbspatch",
122 "libbrotli",
Tianjie99d570d2020-06-04 14:57:19 -0700123 "libc++fs",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700124 "libfec_rs",
125 "libpuffpatch",
126 "libverity_tree",
127 ],
128 shared_libs: [
129 "libbase",
130 "libcrypto",
Sen Jiangb5f631d2018-12-18 16:59:57 -0800131 "libfec",
Tianjie99d570d2020-06-04 14:57:19 -0700132 "libziparchive",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700133 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700134}
135
136cc_library_static {
137 name: "libpayload_consumer",
138 defaults: [
139 "ue_defaults",
140 "libpayload_consumer_exports",
141 ],
142 host_supported: true,
143 recovery_available: true,
144
145 srcs: [
146 "common/action_processor.cc",
147 "common/boot_control_stub.cc",
148 "common/clock.cc",
149 "common/constants.cc",
150 "common/cpu_limiter.cc",
Yifan Hongdaac7322019-11-07 10:48:26 -0800151 "common/dynamic_partition_control_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700152 "common/error_code_utils.cc",
153 "common/file_fetcher.cc",
154 "common/hash_calculator.cc",
155 "common/http_common.cc",
156 "common/http_fetcher.cc",
157 "common/hwid_override.cc",
158 "common/multi_range_http_fetcher.cc",
159 "common/platform_constants_android.cc",
160 "common/prefs.cc",
161 "common/proxy_resolver.cc",
162 "common/subprocess.cc",
163 "common/terminator.cc",
164 "common/utils.cc",
165 "payload_consumer/bzip_extent_writer.cc",
166 "payload_consumer/cached_file_descriptor.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700167 "payload_consumer/certificate_parser_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700168 "payload_consumer/delta_performer.cc",
169 "payload_consumer/download_action.cc",
170 "payload_consumer/extent_reader.cc",
171 "payload_consumer/extent_writer.cc",
172 "payload_consumer/file_descriptor.cc",
173 "payload_consumer/file_descriptor_utils.cc",
174 "payload_consumer/file_writer.cc",
175 "payload_consumer/filesystem_verifier_action.cc",
176 "payload_consumer/install_plan.cc",
177 "payload_consumer/mount_history.cc",
178 "payload_consumer/payload_constants.cc",
179 "payload_consumer/payload_metadata.cc",
180 "payload_consumer/payload_verifier.cc",
181 "payload_consumer/postinstall_runner_action.cc",
182 "payload_consumer/verity_writer_android.cc",
183 "payload_consumer/xz_extent_writer.cc",
184 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700185 "payload_consumer/partition_update_generator_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700186 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700187}
188
189// libupdate_engine_boot_control (type: static_library)
190// ========================================================
191// A BootControl class implementation using Android's HIDL boot_control HAL.
192cc_defaults {
193 name: "libupdate_engine_boot_control_exports",
194 defaults: ["update_metadata-protos_exports"],
195
Yifan Hong420db9b2019-07-23 20:50:33 -0700196 static_libs: [
David Andersone7ce8212019-12-16 20:13:19 -0800197 "libcutils",
198 "libfs_mgr_binder",
199 "libgsi",
Yifan Hongdad0af82020-02-19 17:19:49 -0800200 "libpayload_consumer",
Yifan Hong420db9b2019-07-23 20:50:33 -0700201 "libsnapshot",
202 "update_metadata-protos",
203 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700204 shared_libs: [
205 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700206 "libhidlbase",
207 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800208 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700209 "libutils",
210 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700211 "android.hardware.boot@1.1",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700212 ],
Yifan Hong29692902020-03-26 12:47:05 -0700213 header_libs: [
214 "avb_headers",
215 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700216 target: {
217 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800218 static_libs: [
219 "libfs_mgr",
220 "libsnapshot_nobinder",
221 ],
222 exclude_static_libs: [
223 "libfs_mgr_binder",
224 "libsnapshot",
225 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800226 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800227 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800228 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700229 },
230 },
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700231}
232
233cc_library_static {
234 name: "libupdate_engine_boot_control",
235 defaults: [
236 "ue_defaults",
237 "libupdate_engine_boot_control_exports",
Yifan Hongdad0af82020-02-19 17:19:49 -0800238 "libpayload_consumer_exports",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700239 ],
240 recovery_available: true,
241
242 srcs: [
243 "boot_control_android.cc",
Yifan Hongdad0af82020-02-19 17:19:49 -0800244 "cleanup_previous_update_action.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700245 "dynamic_partition_control_android.cc",
Yifan Hong012508e2019-07-22 18:30:40 -0700246 "dynamic_partition_utils.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700247 ],
248}
249
250// libupdate_engine_android (type: static_library)
251// ========================================================
252// The main daemon static_library used in Android (non-Brillo). This only has a
253// loop to apply payloads provided by the upper layer via a Binder interface.
254cc_defaults {
255 name: "libupdate_engine_android_exports",
256 defaults: [
257 "ue_defaults",
258 "libpayload_consumer_exports",
259 "libupdate_engine_boot_control_exports",
260 ],
261
262 static_libs: [
263 "libpayload_consumer",
264 "libupdate_engine_boot_control",
265 ],
266 shared_libs: [
267 "libandroid_net",
268 "libbase",
269 "libbinder",
270 "libbinderwrapper",
271 "libbootloader_message",
272 "libbrillo-binder",
273 "libcurl",
274 "libcutils",
Yifan Hong2562cf22020-07-21 19:28:44 -0700275 "libupdate_engine_stable-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700276 "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",
Yifan Hong2562cf22020-07-21 19:28:44 -0700302 "binder_service_stable_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700303 "certificate_checker.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700304 "daemon_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700305 "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",
Yifan Honge7574202020-04-06 15:08:24 -0700360 "logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700361 "metrics_reporter_stub.cc",
362 "metrics_utils.cc",
363 "network_selector_stub.cc",
364 "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
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700410// update_engine_client (type: executable)
411// ========================================================
412// update_engine console client.
413cc_binary {
414 name: "update_engine_client",
415 defaults: ["ue_defaults"],
416
417 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
418 // out of the DBus interface.
419 include_dirs: ["external/cros/system_api/dbus"],
420
421 shared_libs: [
422 "libbinder",
423 "libbinderwrapper",
424 "libbrillo-binder",
425 "libutils",
426 ],
427
428 aidl: {
429 local_include_dirs: ["binder_bindings"],
430 },
431
432 srcs: [
433 ":libupdate_engine_aidl",
434 "common/error_code_utils.cc",
435 "update_engine_client_android.cc",
436 "update_status_utils.cc",
437 ],
438}
439
440// libpayload_generator (type: static_library)
441// ========================================================
442// server-side code. This is used for delta_generator and unittests but not
443// for any client code.
444cc_defaults {
445 name: "libpayload_generator_exports",
446 defaults: [
447 "libpayload_consumer_exports",
448 "update_metadata-protos_exports",
449 ],
450
Tianjie37ae8562020-03-25 15:16:01 -0700451 header_libs: [
452 "bootimg_headers",
453 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700454 static_libs: [
455 "libavb",
456 "libbrotli",
457 "libbsdiff",
458 "libdivsufsort",
459 "libdivsufsort64",
460 "liblzma",
461 "libpayload_consumer",
462 "libpuffdiff",
463 "libverity_tree",
464 "update_metadata-protos",
465 ],
466 shared_libs: [
467 "libbase",
468 "libext2fs",
469 ],
470}
471
472cc_library_static {
473 name: "libpayload_generator",
474 defaults: [
475 "ue_defaults",
476 "libpayload_generator_exports",
477 ],
478 host_supported: true,
479
480 srcs: [
481 "payload_generator/ab_generator.cc",
482 "payload_generator/annotated_operation.cc",
483 "payload_generator/blob_file_writer.cc",
484 "payload_generator/block_mapping.cc",
485 "payload_generator/boot_img_filesystem.cc",
486 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700487 "payload_generator/deflate_utils.cc",
488 "payload_generator/delta_diff_generator.cc",
489 "payload_generator/delta_diff_utils.cc",
490 "payload_generator/ext2_filesystem.cc",
491 "payload_generator/extent_ranges.cc",
492 "payload_generator/extent_utils.cc",
493 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700494 "payload_generator/mapfile_filesystem.cc",
495 "payload_generator/payload_file.cc",
496 "payload_generator/payload_generation_config_android.cc",
497 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700498 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700499 "payload_generator/payload_signer.cc",
500 "payload_generator/raw_filesystem.cc",
501 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700502 "payload_generator/xz_android.cc",
503 ],
504}
505
506// delta_generator (type: executable)
507// ========================================================
508// server-side delta generator.
509cc_binary_host {
510 name: "delta_generator",
511 defaults: [
512 "ue_defaults",
513 "libpayload_generator_exports",
514 "libpayload_consumer_exports",
515 ],
516
517 static_libs: [
518 "libavb_host_sysdeps",
519 "libpayload_consumer",
520 "libpayload_generator",
521 ],
522
523 srcs: ["payload_generator/generate_delta_main.cc"],
524}
525
526cc_test {
527 name: "ue_unittest_delta_generator",
528 defaults: [
529 "ue_defaults",
530 "libpayload_generator_exports",
531 "libpayload_consumer_exports",
532 ],
533
534 static_libs: [
535 "libpayload_consumer",
536 "libpayload_generator",
537 ],
538
539 srcs: ["payload_generator/generate_delta_main.cc"],
540
541 gtest: false,
542 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700543}
544
545// test_http_server (type: executable)
546// ========================================================
547// Test HTTP Server.
548cc_test {
549 name: "test_http_server",
550 defaults: ["ue_defaults"],
551 srcs: [
552 "common/http_common.cc",
553 "test_http_server.cc",
554 ],
555
556 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700557}
558
559// test_subprocess (type: executable)
560// ========================================================
561// Test helper subprocess program.
562cc_test {
563 name: "test_subprocess",
564 defaults: ["ue_defaults"],
565 srcs: ["test_subprocess.cc"],
566
567 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700568}
569
570// Public keys for unittests.
571// ========================================================
572genrule {
573 name: "ue_unittest_keys",
574 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700575 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700576 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
577 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700578 srcs: [
579 "unittest_key.pem",
580 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700581 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700582 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700583 ],
584 out: [
585 "unittest_key.pub.pem",
586 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700587 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700588 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700589 ],
590}
591
592// Sample images for unittests.
593// ========================================================
594// Extract sample image from the compressed sample_images.tar.bz2 file used by
595// the unittests.
596genrule {
597 name: "ue_unittest_disk_imgs",
598 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
599 srcs: ["sample_images/sample_images.tar.bz2"],
600 out: [
601 "gen/disk_ext2_1k.img",
602 "gen/disk_ext2_4k.img",
603 "gen/disk_ext2_4k_empty.img",
604 "gen/disk_ext2_unittest.img",
605 ],
606}
607
608// update_engine_unittests (type: executable)
609// ========================================================
610// Main unittest file.
611cc_test {
612 name: "update_engine_unittests",
613 defaults: [
614 "ue_defaults",
615 "libpayload_generator_exports",
616 "libupdate_engine_android_exports",
617 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700618
619 static_libs: [
620 "libpayload_generator",
621 "libbrillo-test-helpers",
622 "libgmock",
623 "libchrome_test_helpers",
624 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -0800625 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700626 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700627
Yifan Hong87ea73f2019-09-12 13:07:37 -0700628 header_libs: [
629 "libstorage_literals_headers",
630 ],
631
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700632 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -0700633 ":test_http_server",
634 ":test_subprocess",
635 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700636 ":ue_unittest_disk_imgs",
637 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700638 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700639 "unittest_key.pem",
640 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700641 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700642 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700643 "update_engine.conf",
644 ],
645
Tao Bao9456b6f2019-04-29 18:14:58 -0700646 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
647 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
648 test_config: "test_config.xml",
649 test_suites: ["device-tests"],
650
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700651 srcs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700652 "certificate_checker_unittest.cc",
653 "common/action_pipe_unittest.cc",
654 "common/action_processor_unittest.cc",
655 "common/action_unittest.cc",
656 "common/cpu_limiter_unittest.cc",
657 "common/fake_prefs.cc",
658 "common/file_fetcher_unittest.cc",
659 "common/hash_calculator_unittest.cc",
660 "common/http_fetcher_unittest.cc",
661 "common/hwid_override_unittest.cc",
662 "common/mock_http_fetcher.cc",
663 "common/prefs_unittest.cc",
664 "common/proxy_resolver_unittest.cc",
665 "common/subprocess_unittest.cc",
666 "common/terminator_unittest.cc",
667 "common/test_utils.cc",
668 "common/utils_unittest.cc",
Yifan Hongc049f932019-07-23 15:06:05 -0700669 "dynamic_partition_control_android_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700670 "libcurl_http_fetcher_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700671 "payload_consumer/bzip_extent_writer_unittest.cc",
672 "payload_consumer/cached_file_descriptor_unittest.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700673 "payload_consumer/certificate_parser_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700674 "payload_consumer/delta_performer_integration_test.cc",
675 "payload_consumer/delta_performer_unittest.cc",
Kelvin Zhang9dd93052020-07-21 17:31:19 -0400676 "payload_consumer/download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700677 "payload_consumer/extent_reader_unittest.cc",
678 "payload_consumer/extent_writer_unittest.cc",
679 "payload_consumer/fake_file_descriptor.cc",
680 "payload_consumer/file_descriptor_utils_unittest.cc",
681 "payload_consumer/file_writer_unittest.cc",
682 "payload_consumer/filesystem_verifier_action_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -0700683 "payload_consumer/partition_update_generator_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700684 "payload_consumer/postinstall_runner_action_unittest.cc",
685 "payload_consumer/verity_writer_android_unittest.cc",
686 "payload_consumer/xz_extent_writer_unittest.cc",
687 "payload_generator/ab_generator_unittest.cc",
688 "payload_generator/blob_file_writer_unittest.cc",
689 "payload_generator/block_mapping_unittest.cc",
690 "payload_generator/boot_img_filesystem_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700691 "payload_generator/deflate_utils_unittest.cc",
692 "payload_generator/delta_diff_utils_unittest.cc",
693 "payload_generator/ext2_filesystem_unittest.cc",
694 "payload_generator/extent_ranges_unittest.cc",
695 "payload_generator/extent_utils_unittest.cc",
696 "payload_generator/fake_filesystem.cc",
697 "payload_generator/full_update_generator_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700698 "payload_generator/mapfile_filesystem_unittest.cc",
699 "payload_generator/payload_file_unittest.cc",
700 "payload_generator/payload_generation_config_android_unittest.cc",
701 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700702 "payload_generator/payload_properties_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700703 "payload_generator/payload_signer_unittest.cc",
704 "payload_generator/squashfs_filesystem_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700705 "payload_generator/zip_unittest.cc",
706 "testrunner.cc",
707 "update_attempter_android_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700708 "update_status_utils_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700709 ],
710}
711
712// Brillo update payload generation script
713// ========================================================
714cc_prebuilt_binary {
715 name: "brillo_update_payload",
716 device_supported: false,
717 host_supported: true,
718
719 srcs: ["scripts/brillo_update_payload"],
720 required: [
721 "delta_generator",
722 "shflags",
723 "simg2img",
724 ],
725
726 target: {
727 darwin: {
728 enabled: false,
729 },
730 },
Colin Cross606913a2017-11-14 13:05:37 -0800731}
Yifan Hongd51738c2020-07-23 17:06:25 -0700732
733// update_engine header library
734cc_library_headers {
735 name: "libupdate_engine_headers",
736 export_include_dirs: ["."],
737 apex_available: [
738 "com.android.gki.*",
739 ],
740}