blob: 8e9ec17f97bf3ba688b7e54906f6010c54a52971 [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",
Kelvin Zhang50bac652020-09-28 15:51:41 -0400181 "payload_consumer/partition_writer.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700182 "payload_consumer/postinstall_runner_action.cc",
183 "payload_consumer/verity_writer_android.cc",
184 "payload_consumer/xz_extent_writer.cc",
185 "payload_consumer/fec_file_descriptor.cc",
Tianjied3865d12020-06-03 15:25:17 -0700186 "payload_consumer/partition_update_generator_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700187 ],
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",
David Anderson420bed52020-09-21 17:09:53 -0700203 "libsnapshot_cow",
Yifan Hong420db9b2019-07-23 20:50:33 -0700204 "update_metadata-protos",
205 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700206 shared_libs: [
207 "libbootloader_message",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700208 "libhidlbase",
209 "liblp",
Yifan Hongd976cc52020-02-25 14:51:42 -0800210 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700211 "libutils",
212 "android.hardware.boot@1.0",
David Anderson2111d062019-10-15 22:36:27 -0700213 "android.hardware.boot@1.1",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700214 ],
Yifan Hong29692902020-03-26 12:47:05 -0700215 header_libs: [
216 "avb_headers",
217 ],
Yifan Hong420db9b2019-07-23 20:50:33 -0700218 target: {
219 recovery: {
David Andersone7ce8212019-12-16 20:13:19 -0800220 static_libs: [
221 "libfs_mgr",
222 "libsnapshot_nobinder",
223 ],
224 exclude_static_libs: [
225 "libfs_mgr_binder",
226 "libsnapshot",
227 ],
Yifan Hong212d7952020-02-04 11:08:08 -0800228 exclude_shared_libs: [
Yifan Hongd976cc52020-02-25 14:51:42 -0800229 "libstatslog",
Yifan Hong212d7952020-02-04 11:08:08 -0800230 ],
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: [
Yifan Hong126d13e2020-09-21 19:50:06 -0700265 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700266 "libpayload_consumer",
267 "libupdate_engine_boot_control",
268 ],
269 shared_libs: [
270 "libandroid_net",
271 "libbase",
272 "libbinder",
273 "libbinderwrapper",
274 "libbootloader_message",
275 "libbrillo-binder",
276 "libcurl",
277 "libcutils",
Yifan Hong2562cf22020-07-21 19:28:44 -0700278 "libupdate_engine_stable-cpp",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700279 "liblog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700280 "libssl",
Tianjie Xu75cc9f22019-08-02 14:53:38 -0700281 "libstatslog",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700282 "libutils",
283 ],
284}
285
286cc_library_static {
287 name: "libupdate_engine_android",
288 defaults: [
289 "ue_defaults",
290 "libupdate_engine_android_exports",
291 ],
292
293 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
294 // out of the DBus interface.
295 include_dirs: ["external/cros/system_api/dbus"],
296
297 aidl: {
298 local_include_dirs: ["binder_bindings"],
299 export_aidl_headers: true,
300 },
301
302 srcs: [
303 ":libupdate_engine_aidl",
304 "binder_service_android.cc",
Yifan Hong2562cf22020-07-21 19:28:44 -0700305 "binder_service_stable_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700306 "certificate_checker.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700307 "daemon_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700308 "daemon_state_android.cc",
309 "hardware_android.cc",
310 "libcurl_http_fetcher.cc",
Yifan Hongc80de2d2020-02-25 17:13:53 -0800311 "logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700312 "metrics_utils.cc",
313 "network_selector_android.cc",
314 "update_attempter_android.cc",
315 "update_boot_flags_action.cc",
316 "update_status_utils.cc",
317 ],
318}
319
320// update_engine (type: executable)
321// ========================================================
322// update_engine daemon.
323cc_binary {
324 name: "update_engine",
325 defaults: [
326 "ue_defaults",
327 "libupdate_engine_android_exports",
328 ],
329
330 static_libs: ["libupdate_engine_android"],
Tao Bao1e1c86c2019-04-18 10:48:32 -0700331 required: [
332 "cacerts_google",
Tianjie Xube4ea232019-10-15 18:08:31 -0700333 "otacerts",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700334 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700335
Kelvin Zhanga6e18122020-08-06 15:53:25 -0400336 srcs: ["main.cc", "metrics_reporter_android.cc"],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700337 init_rc: ["update_engine.rc"],
338}
339
340// update_engine_sideload (type: executable)
341// ========================================================
342// A binary executable equivalent to update_engine daemon that installs an update
343// from a local file directly instead of running in the background. Used in
344// recovery image.
345cc_binary {
346 name: "update_engine_sideload",
347 defaults: [
348 "ue_defaults",
349 "update_metadata-protos_exports",
350 "libupdate_engine_boot_control_exports",
351 "libpayload_consumer_exports",
352 ],
353 recovery: true,
354
355 cflags: ["-D_UE_SIDELOAD"],
356 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
357 // out of the DBus interface.
358 include_dirs: ["external/cros/system_api/dbus"],
359
360 srcs: [
361 "hardware_android.cc",
Yifan Honge7574202020-04-06 15:08:24 -0700362 "logging_android.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700363 "metrics_reporter_stub.cc",
364 "metrics_utils.cc",
365 "network_selector_stub.cc",
366 "sideload_main.cc",
367 "update_attempter_android.cc",
368 "update_boot_flags_action.cc",
369 "update_status_utils.cc",
370 ],
371
372 // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out,
373 // as it doesn't look beneficial to be installed separately due to its size. Note
374 // that we explicitly request their recovery variants, so that the expected files
375 // will be used and installed.
376 shared_libs: [
377 "libbase",
378 "liblog",
379 ],
380 static_libs: [
381 "libpayload_consumer",
382 "libupdate_engine_boot_control",
383 "update_metadata-protos",
384
385 // We add the static versions of the shared libraries that are not installed to
386 // recovery image due to size concerns. Need to include all the static library
387 // dependencies of these static libraries.
Yifan Hong126d13e2020-09-21 19:50:06 -0700388 "gkiprops",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700389 "libevent",
390 "libmodpb64",
391 "libgtest_prod",
392 "libprotobuf-cpp-lite",
393 "libbrillo-stream",
394 "libbrillo",
395 "libchrome",
396 ],
397 target: {
398 recovery: {
399 exclude_shared_libs: [
400 "libprotobuf-cpp-lite",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700401 "libbrillo-stream",
402 "libbrillo",
403 "libchrome",
404 ],
405 },
406 },
407
Tao Bao1e1c86c2019-04-18 10:48:32 -0700408 required: [
Tianjie Xube4ea232019-10-15 18:08:31 -0700409 "otacerts.recovery",
Tao Bao1e1c86c2019-04-18 10:48:32 -0700410 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700411}
412
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700413// update_engine_client (type: executable)
414// ========================================================
415// update_engine console client.
416cc_binary {
417 name: "update_engine_client",
418 defaults: ["ue_defaults"],
419
420 // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
421 // out of the DBus interface.
422 include_dirs: ["external/cros/system_api/dbus"],
423
424 shared_libs: [
425 "libbinder",
426 "libbinderwrapper",
427 "libbrillo-binder",
428 "libutils",
429 ],
430
431 aidl: {
432 local_include_dirs: ["binder_bindings"],
433 },
434
435 srcs: [
436 ":libupdate_engine_aidl",
437 "common/error_code_utils.cc",
438 "update_engine_client_android.cc",
439 "update_status_utils.cc",
440 ],
441}
442
443// libpayload_generator (type: static_library)
444// ========================================================
445// server-side code. This is used for delta_generator and unittests but not
446// for any client code.
447cc_defaults {
448 name: "libpayload_generator_exports",
449 defaults: [
450 "libpayload_consumer_exports",
451 "update_metadata-protos_exports",
452 ],
453
Tianjie37ae8562020-03-25 15:16:01 -0700454 header_libs: [
455 "bootimg_headers",
456 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700457 static_libs: [
458 "libavb",
459 "libbrotli",
460 "libbsdiff",
461 "libdivsufsort",
462 "libdivsufsort64",
463 "liblzma",
464 "libpayload_consumer",
465 "libpuffdiff",
466 "libverity_tree",
467 "update_metadata-protos",
468 ],
469 shared_libs: [
470 "libbase",
471 "libext2fs",
472 ],
473}
474
475cc_library_static {
David Andersonc1c93052020-08-26 18:22:09 +0000476 name: "libpayload_extent_ranges",
477 defaults: [
478 "ue_defaults",
479 ],
480 host_supported: true,
481 srcs: [
482 "payload_generator/extent_ranges.cc",
483 ],
484 static_libs: [
485 "update_metadata-protos",
486 ],
487}
488
489cc_library_static {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700490 name: "libpayload_generator",
491 defaults: [
492 "ue_defaults",
493 "libpayload_generator_exports",
494 ],
495 host_supported: true,
496
497 srcs: [
498 "payload_generator/ab_generator.cc",
499 "payload_generator/annotated_operation.cc",
500 "payload_generator/blob_file_writer.cc",
501 "payload_generator/block_mapping.cc",
502 "payload_generator/boot_img_filesystem.cc",
503 "payload_generator/bzip.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700504 "payload_generator/deflate_utils.cc",
505 "payload_generator/delta_diff_generator.cc",
506 "payload_generator/delta_diff_utils.cc",
507 "payload_generator/ext2_filesystem.cc",
508 "payload_generator/extent_ranges.cc",
509 "payload_generator/extent_utils.cc",
510 "payload_generator/full_update_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700511 "payload_generator/mapfile_filesystem.cc",
Tianjiee9156ec2020-08-11 11:13:54 -0700512 "payload_generator/merge_sequence_generator.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700513 "payload_generator/payload_file.cc",
514 "payload_generator/payload_generation_config_android.cc",
515 "payload_generator/payload_generation_config.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700516 "payload_generator/payload_properties.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700517 "payload_generator/payload_signer.cc",
518 "payload_generator/raw_filesystem.cc",
519 "payload_generator/squashfs_filesystem.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700520 "payload_generator/xz_android.cc",
521 ],
522}
523
524// delta_generator (type: executable)
525// ========================================================
526// server-side delta generator.
527cc_binary_host {
528 name: "delta_generator",
529 defaults: [
530 "ue_defaults",
531 "libpayload_generator_exports",
532 "libpayload_consumer_exports",
533 ],
534
535 static_libs: [
536 "libavb_host_sysdeps",
537 "libpayload_consumer",
538 "libpayload_generator",
539 ],
540
541 srcs: ["payload_generator/generate_delta_main.cc"],
542}
543
544cc_test {
545 name: "ue_unittest_delta_generator",
546 defaults: [
547 "ue_defaults",
548 "libpayload_generator_exports",
549 "libpayload_consumer_exports",
550 ],
551
552 static_libs: [
553 "libpayload_consumer",
554 "libpayload_generator",
555 ],
556
557 srcs: ["payload_generator/generate_delta_main.cc"],
558
559 gtest: false,
560 stem: "delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700561}
562
563// test_http_server (type: executable)
564// ========================================================
565// Test HTTP Server.
566cc_test {
567 name: "test_http_server",
568 defaults: ["ue_defaults"],
569 srcs: [
570 "common/http_common.cc",
571 "test_http_server.cc",
572 ],
573
574 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700575}
576
577// test_subprocess (type: executable)
578// ========================================================
579// Test helper subprocess program.
580cc_test {
581 name: "test_subprocess",
582 defaults: ["ue_defaults"],
583 srcs: ["test_subprocess.cc"],
584
585 gtest: false,
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700586}
587
588// Public keys for unittests.
589// ========================================================
590genrule {
591 name: "ue_unittest_keys",
592 cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" +
xunchangcda3c032019-03-26 15:41:14 -0700593 "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700594 "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" +
595 "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700596 srcs: [
597 "unittest_key.pem",
598 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700599 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700600 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700601 ],
602 out: [
603 "unittest_key.pub.pem",
604 "unittest_key2.pub.pem",
xunchangcda3c032019-03-26 15:41:14 -0700605 "unittest_key_RSA4096.pub.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700606 "unittest_key_EC.pub.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700607 ],
608}
609
610// Sample images for unittests.
611// ========================================================
612// Extract sample image from the compressed sample_images.tar.bz2 file used by
613// the unittests.
614genrule {
615 name: "ue_unittest_disk_imgs",
616 cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img",
617 srcs: ["sample_images/sample_images.tar.bz2"],
618 out: [
619 "gen/disk_ext2_1k.img",
620 "gen/disk_ext2_4k.img",
621 "gen/disk_ext2_4k_empty.img",
622 "gen/disk_ext2_unittest.img",
623 ],
624}
625
626// update_engine_unittests (type: executable)
627// ========================================================
628// Main unittest file.
629cc_test {
630 name: "update_engine_unittests",
631 defaults: [
632 "ue_defaults",
633 "libpayload_generator_exports",
634 "libupdate_engine_android_exports",
635 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700636
637 static_libs: [
638 "libpayload_generator",
639 "libbrillo-test-helpers",
640 "libgmock",
641 "libchrome_test_helpers",
642 "libupdate_engine_android",
Tianjie Xu173e6192019-12-10 10:56:01 -0800643 "libdm",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700644 ],
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700645
Yifan Hong87ea73f2019-09-12 13:07:37 -0700646 header_libs: [
647 "libstorage_literals_headers",
648 ],
649
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700650 data: [
Tao Bao9456b6f2019-04-29 18:14:58 -0700651 ":test_http_server",
652 ":test_subprocess",
653 ":ue_unittest_delta_generator",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700654 ":ue_unittest_disk_imgs",
655 ":ue_unittest_keys",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700656 "otacerts.zip",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700657 "unittest_key.pem",
658 "unittest_key2.pem",
xunchangcda3c032019-03-26 15:41:14 -0700659 "unittest_key_RSA4096.pem",
Tianjie Xu7bbe0152019-10-09 18:11:15 -0700660 "unittest_key_EC.pem",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700661 "update_engine.conf",
662 ],
663
Tao Bao9456b6f2019-04-29 18:14:58 -0700664 // We cannot use the default generated AndroidTest.xml because of the use of helper modules
665 // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator).
666 test_config: "test_config.xml",
667 test_suites: ["device-tests"],
668
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700669 srcs: [
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700670 "certificate_checker_unittest.cc",
671 "common/action_pipe_unittest.cc",
672 "common/action_processor_unittest.cc",
673 "common/action_unittest.cc",
674 "common/cpu_limiter_unittest.cc",
675 "common/fake_prefs.cc",
676 "common/file_fetcher_unittest.cc",
677 "common/hash_calculator_unittest.cc",
678 "common/http_fetcher_unittest.cc",
679 "common/hwid_override_unittest.cc",
680 "common/mock_http_fetcher.cc",
681 "common/prefs_unittest.cc",
682 "common/proxy_resolver_unittest.cc",
683 "common/subprocess_unittest.cc",
684 "common/terminator_unittest.cc",
685 "common/test_utils.cc",
686 "common/utils_unittest.cc",
Yifan Hongc049f932019-07-23 15:06:05 -0700687 "dynamic_partition_control_android_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700688 "libcurl_http_fetcher_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700689 "payload_consumer/bzip_extent_writer_unittest.cc",
690 "payload_consumer/cached_file_descriptor_unittest.cc",
Tianjie Xu7a78d632019-10-08 16:32:39 -0700691 "payload_consumer/certificate_parser_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700692 "payload_consumer/delta_performer_integration_test.cc",
693 "payload_consumer/delta_performer_unittest.cc",
Kelvin Zhang9bd519d2020-09-23 12:55:19 -0400694 "payload_consumer/partition_writer_unittest.cc",
Kelvin Zhang9dd93052020-07-21 17:31:19 -0400695 "payload_consumer/download_action_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700696 "payload_consumer/extent_reader_unittest.cc",
697 "payload_consumer/extent_writer_unittest.cc",
698 "payload_consumer/fake_file_descriptor.cc",
699 "payload_consumer/file_descriptor_utils_unittest.cc",
700 "payload_consumer/file_writer_unittest.cc",
701 "payload_consumer/filesystem_verifier_action_unittest.cc",
Tianjie99d570d2020-06-04 14:57:19 -0700702 "payload_consumer/partition_update_generator_android_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700703 "payload_consumer/postinstall_runner_action_unittest.cc",
704 "payload_consumer/verity_writer_android_unittest.cc",
705 "payload_consumer/xz_extent_writer_unittest.cc",
706 "payload_generator/ab_generator_unittest.cc",
707 "payload_generator/blob_file_writer_unittest.cc",
708 "payload_generator/block_mapping_unittest.cc",
709 "payload_generator/boot_img_filesystem_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700710 "payload_generator/deflate_utils_unittest.cc",
711 "payload_generator/delta_diff_utils_unittest.cc",
712 "payload_generator/ext2_filesystem_unittest.cc",
713 "payload_generator/extent_ranges_unittest.cc",
714 "payload_generator/extent_utils_unittest.cc",
715 "payload_generator/fake_filesystem.cc",
716 "payload_generator/full_update_generator_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700717 "payload_generator/mapfile_filesystem_unittest.cc",
Tianjie87af6c02020-08-11 15:06:26 -0700718 "payload_generator/merge_sequence_generator_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700719 "payload_generator/payload_file_unittest.cc",
720 "payload_generator/payload_generation_config_android_unittest.cc",
721 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700722 "payload_generator/payload_properties_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700723 "payload_generator/payload_signer_unittest.cc",
724 "payload_generator/squashfs_filesystem_unittest.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700725 "payload_generator/zip_unittest.cc",
726 "testrunner.cc",
727 "update_attempter_android_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700728 "update_status_utils_unittest.cc",
Kelvin Zhanga6e18122020-08-06 15:53:25 -0400729 "metrics_reporter_stub.cc",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700730 ],
731}
732
733// Brillo update payload generation script
734// ========================================================
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +0100735sh_binary {
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700736 name: "brillo_update_payload",
737 device_supported: false,
738 host_supported: true,
739
Martin Stjernholm18e9f3c2020-09-08 13:56:59 +0100740 src: "scripts/brillo_update_payload",
Dan Willemsenf5a904e2018-10-23 01:02:44 -0700741 required: [
742 "delta_generator",
743 "shflags",
744 "simg2img",
745 ],
746
747 target: {
748 darwin: {
749 enabled: false,
750 },
751 },
Colin Cross606913a2017-11-14 13:05:37 -0800752}
Yifan Hongd51738c2020-07-23 17:06:25 -0700753
754// update_engine header library
755cc_library_headers {
756 name: "libupdate_engine_headers",
757 export_include_dirs: ["."],
758 apex_available: [
759 "com.android.gki.*",
David Anderson5e6dfe32020-09-17 15:50:33 -0700760 "//apex_available:platform",
Yifan Hongd51738c2020-07-23 17:06:25 -0700761 ],
David Andersonc1c93052020-08-26 18:22:09 +0000762 host_supported: true,
David Anderson5e6dfe32020-09-17 15:50:33 -0700763 recovery_available: true,
764 ramdisk_available: true,
765
766 target: {
767 darwin: {
768 enabled: false,
769 },
770 }
Yifan Hongd51738c2020-07-23 17:06:25 -0700771}