Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 1 | // |
| 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 Cross | 606913a | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 17 | // AIDL interface between libupdate_engine and framework.jar |
Bob Badour | 9b85a6c | 2021-02-12 21:28:32 -0800 | [diff] [blame] | 18 | package { |
| 19 | default_applicable_licenses: ["system_update_engine_license"], |
| 20 | } |
| 21 | |
| 22 | // Added automatically by a large-scale-change |
| 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "system_update_engine_license", |
| 26 | visibility: [":__subpackages__"], |
| 27 | license_kinds: [ |
| 28 | "SPDX-license-identifier-Apache-2.0", |
| 29 | ], |
| 30 | license_text: [ |
| 31 | "NOTICE", |
| 32 | ], |
| 33 | } |
| 34 | |
Colin Cross | 606913a | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 35 | filegroup { |
| 36 | name: "libupdate_engine_aidl", |
| 37 | srcs: [ |
| 38 | "binder_bindings/android/os/IUpdateEngine.aidl", |
| 39 | "binder_bindings/android/os/IUpdateEngineCallback.aidl", |
| 40 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 41 | path: "binder_bindings", |
| 42 | } |
| 43 | |
| 44 | cc_defaults { |
| 45 | name: "ue_defaults", |
| 46 | |
| 47 | cflags: [ |
Amin Hassani | 2e4eda5 | 2019-01-07 14:01:17 -0800 | [diff] [blame] | 48 | "-DBASE_VER=576279", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 49 | "-DUSE_HWID_OVERRIDE=0", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 50 | "-D_FILE_OFFSET_BITS=64", |
| 51 | "-D_POSIX_C_SOURCE=199309L", |
| 52 | "-Wa,--noexecstack", |
| 53 | "-Wall", |
| 54 | "-Werror", |
| 55 | "-Wextra", |
| 56 | "-Wformat=2", |
| 57 | "-Wno-psabi", |
| 58 | "-Wno-unused-parameter", |
| 59 | "-ffunction-sections", |
| 60 | "-fstack-protector-strong", |
| 61 | "-fvisibility=hidden", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 62 | "-g3", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 63 | ], |
| 64 | cppflags: [ |
| 65 | "-Wnon-virtual-dtor", |
| 66 | "-fno-strict-aliasing", |
| 67 | ], |
| 68 | include_dirs: ["system"], |
| 69 | local_include_dirs: ["client_library/include"], |
Elliott Hughes | 88f3c8c | 2021-04-22 13:47:21 -0700 | [diff] [blame] | 70 | header_libs: ["libgtest_prod_headers"], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 71 | shared_libs: [ |
| 72 | "libbrillo-stream", |
| 73 | "libbrillo", |
| 74 | "libchrome", |
| 75 | ], |
| 76 | ldflags: ["-Wl,--gc-sections"], |
| 77 | |
| 78 | product_variables: { |
| 79 | pdk: { |
| 80 | enabled: false, |
| 81 | }, |
| 82 | }, |
| 83 | |
| 84 | target: { |
Sen Jiang | b5f631d | 2018-12-18 16:59:57 -0800 | [diff] [blame] | 85 | android: { |
| 86 | cflags: [ |
| 87 | "-DUSE_FEC=1", |
| 88 | ], |
| 89 | }, |
| 90 | host: { |
| 91 | cflags: [ |
| 92 | "-DUSE_FEC=0", |
| 93 | ], |
| 94 | }, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 95 | darwin: { |
| 96 | enabled: false, |
| 97 | }, |
| 98 | }, |
| 99 | } |
| 100 | |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 101 | // libcow_operation_convert (type: library) |
| 102 | // ======================================================== |
Kelvin Zhang | eb8703b | 2020-12-10 14:17:21 -0500 | [diff] [blame] | 103 | cc_library_static { |
| 104 | name: "libpayload_extent_utils", |
| 105 | defaults: [ |
| 106 | "ue_defaults", |
| 107 | ], |
| 108 | host_supported: true, |
| 109 | recovery_available: true, |
| 110 | srcs: [ |
| 111 | "payload_generator/extent_utils.cc", |
| 112 | ], |
| 113 | static_libs: [ |
| 114 | "update_metadata-protos", |
| 115 | ], |
| 116 | } |
| 117 | |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 118 | cc_library { |
| 119 | name: "libcow_operation_convert", |
| 120 | host_supported: true, |
| 121 | recovery_available: true, |
| 122 | defaults: [ |
| 123 | "ue_defaults", |
| 124 | "update_metadata-protos_exports", |
| 125 | ], |
| 126 | srcs: [ |
| 127 | "common/cow_operation_convert.cc", |
| 128 | ], |
| 129 | static_libs: [ |
| 130 | "libsnapshot_cow", |
| 131 | "update_metadata-protos", |
| 132 | "libpayload_extent_ranges", |
Kelvin Zhang | eb8703b | 2020-12-10 14:17:21 -0500 | [diff] [blame] | 133 | "libpayload_extent_utils", |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 134 | "libbrotli", |
| 135 | "libz", |
| 136 | ], |
| 137 | } |
| 138 | |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 139 | // update_metadata-protos (type: static_library) |
| 140 | // ======================================================== |
| 141 | // Protobufs. |
| 142 | cc_defaults { |
| 143 | name: "update_metadata-protos_exports", |
| 144 | |
| 145 | shared_libs: ["libprotobuf-cpp-lite"], |
| 146 | } |
| 147 | |
| 148 | cc_library_static { |
| 149 | name: "update_metadata-protos", |
| 150 | host_supported: true, |
Inseob Kim | 3cce62a | 2021-06-14 11:55:35 +0900 | [diff] [blame] | 151 | ramdisk_available: true, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 152 | recovery_available: true, |
| 153 | |
| 154 | srcs: ["update_engine/update_metadata.proto"], |
| 155 | cflags: [ |
| 156 | "-Wall", |
| 157 | "-Werror", |
| 158 | ], |
| 159 | proto: { |
| 160 | canonical_path_from_root: false, |
| 161 | export_proto_headers: true, |
| 162 | }, |
| 163 | } |
| 164 | |
| 165 | // libpayload_consumer (type: static_library) |
| 166 | // ======================================================== |
| 167 | // The payload application component and common dependencies. |
| 168 | cc_defaults { |
| 169 | name: "libpayload_consumer_exports", |
| 170 | defaults: ["update_metadata-protos_exports"], |
| 171 | |
| 172 | static_libs: [ |
| 173 | "update_metadata-protos", |
| 174 | "libxz", |
| 175 | "libbz", |
| 176 | "libbspatch", |
| 177 | "libbrotli", |
Tianjie | 99d570d | 2020-06-04 14:57:19 -0700 | [diff] [blame] | 178 | "libc++fs", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 179 | "libfec_rs", |
| 180 | "libpuffpatch", |
| 181 | "libverity_tree", |
Kelvin Zhang | 94f51cc | 2020-09-25 11:34:49 -0400 | [diff] [blame] | 182 | "libsnapshot_cow", |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 183 | "libbrotli", |
| 184 | "libz", |
| 185 | "libpayload_extent_ranges", |
Kelvin Zhang | eb8703b | 2020-12-10 14:17:21 -0500 | [diff] [blame] | 186 | "libpayload_extent_utils", |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 187 | "libcow_operation_convert", |
Kelvin Zhang | 5562403 | 2021-12-20 12:13:24 -0800 | [diff] [blame] | 188 | "lz4diff-protos", |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 189 | "liblz4patch", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 190 | ], |
| 191 | shared_libs: [ |
| 192 | "libbase", |
| 193 | "libcrypto", |
Sen Jiang | b5f631d | 2018-12-18 16:59:57 -0800 | [diff] [blame] | 194 | "libfec", |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 195 | "liblz4", |
Tianjie | 99d570d | 2020-06-04 14:57:19 -0700 | [diff] [blame] | 196 | "libziparchive", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 197 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | cc_library_static { |
| 201 | name: "libpayload_consumer", |
| 202 | defaults: [ |
| 203 | "ue_defaults", |
| 204 | "libpayload_consumer_exports", |
| 205 | ], |
| 206 | host_supported: true, |
| 207 | recovery_available: true, |
| 208 | |
| 209 | srcs: [ |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 210 | "aosp/platform_constants_android.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 211 | "common/action_processor.cc", |
| 212 | "common/boot_control_stub.cc", |
| 213 | "common/clock.cc", |
| 214 | "common/constants.cc", |
| 215 | "common/cpu_limiter.cc", |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 216 | "common/dynamic_partition_control_stub.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 217 | "common/error_code_utils.cc", |
| 218 | "common/file_fetcher.cc", |
| 219 | "common/hash_calculator.cc", |
| 220 | "common/http_common.cc", |
| 221 | "common/http_fetcher.cc", |
| 222 | "common/hwid_override.cc", |
| 223 | "common/multi_range_http_fetcher.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 224 | "common/prefs.cc", |
| 225 | "common/proxy_resolver.cc", |
| 226 | "common/subprocess.cc", |
| 227 | "common/terminator.cc", |
| 228 | "common/utils.cc", |
| 229 | "payload_consumer/bzip_extent_writer.cc", |
| 230 | "payload_consumer/cached_file_descriptor.cc", |
Tianjie Xu | 7a78d63 | 2019-10-08 16:32:39 -0700 | [diff] [blame] | 231 | "payload_consumer/certificate_parser_android.cc", |
Kelvin Zhang | 569c97e | 2020-10-26 12:12:24 -0400 | [diff] [blame] | 232 | "payload_consumer/cow_writer_file_descriptor.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 233 | "payload_consumer/delta_performer.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 234 | "payload_consumer/extent_reader.cc", |
| 235 | "payload_consumer/extent_writer.cc", |
| 236 | "payload_consumer/file_descriptor.cc", |
| 237 | "payload_consumer/file_descriptor_utils.cc", |
| 238 | "payload_consumer/file_writer.cc", |
| 239 | "payload_consumer/filesystem_verifier_action.cc", |
Kelvin Zhang | 40d9666 | 2021-02-24 14:21:29 -0500 | [diff] [blame] | 240 | "payload_consumer/install_operation_executor.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 241 | "payload_consumer/install_plan.cc", |
| 242 | "payload_consumer/mount_history.cc", |
| 243 | "payload_consumer/payload_constants.cc", |
| 244 | "payload_consumer/payload_metadata.cc", |
| 245 | "payload_consumer/payload_verifier.cc", |
Kelvin Zhang | 50bac65 | 2020-09-28 15:51:41 -0400 | [diff] [blame] | 246 | "payload_consumer/partition_writer.cc", |
Kelvin Zhang | 94f51cc | 2020-09-25 11:34:49 -0400 | [diff] [blame] | 247 | "payload_consumer/partition_writer_factory_android.cc", |
| 248 | "payload_consumer/vabc_partition_writer.cc", |
Kelvin Zhang | 4bb4920 | 2021-07-08 21:39:05 -0400 | [diff] [blame] | 249 | "payload_consumer/xor_extent_writer.cc", |
Kelvin Zhang | b170676 | 2021-06-25 15:05:22 -0400 | [diff] [blame] | 250 | "payload_consumer/block_extent_writer.cc", |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 251 | "payload_consumer/snapshot_extent_writer.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 252 | "payload_consumer/postinstall_runner_action.cc", |
Kelvin Zhang | ab3ce60 | 2021-02-24 14:46:40 -0500 | [diff] [blame] | 253 | "payload_consumer/verified_source_fd.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 254 | "payload_consumer/verity_writer_android.cc", |
| 255 | "payload_consumer/xz_extent_writer.cc", |
| 256 | "payload_consumer/fec_file_descriptor.cc", |
Tianjie | d3865d1 | 2020-06-03 15:25:17 -0700 | [diff] [blame] | 257 | "payload_consumer/partition_update_generator_android.cc", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 258 | "update_status_utils.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 259 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | // libupdate_engine_boot_control (type: static_library) |
| 263 | // ======================================================== |
| 264 | // A BootControl class implementation using Android's HIDL boot_control HAL. |
| 265 | cc_defaults { |
| 266 | name: "libupdate_engine_boot_control_exports", |
| 267 | defaults: ["update_metadata-protos_exports"], |
| 268 | |
Yifan Hong | 420db9b | 2019-07-23 20:50:33 -0700 | [diff] [blame] | 269 | static_libs: [ |
David Anderson | e7ce821 | 2019-12-16 20:13:19 -0800 | [diff] [blame] | 270 | "libcutils", |
| 271 | "libfs_mgr_binder", |
| 272 | "libgsi", |
Yifan Hong | dad0af8 | 2020-02-19 17:19:49 -0800 | [diff] [blame] | 273 | "libpayload_consumer", |
Yifan Hong | 420db9b | 2019-07-23 20:50:33 -0700 | [diff] [blame] | 274 | "libsnapshot", |
David Anderson | 6c190a2 | 2020-09-21 17:09:53 -0700 | [diff] [blame] | 275 | "libsnapshot_cow", |
| 276 | "libz", |
Yifan Hong | 420db9b | 2019-07-23 20:50:33 -0700 | [diff] [blame] | 277 | "update_metadata-protos", |
| 278 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 279 | shared_libs: [ |
| 280 | "libbootloader_message", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 281 | "libhidlbase", |
| 282 | "liblp", |
Yifan Hong | d976cc5 | 2020-02-25 14:51:42 -0800 | [diff] [blame] | 283 | "libstatslog", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 284 | "libutils", |
| 285 | "android.hardware.boot@1.0", |
David Anderson | 2111d06 | 2019-10-15 22:36:27 -0700 | [diff] [blame] | 286 | "android.hardware.boot@1.1", |
Kelvin Zhang | cb419e6 | 2021-06-16 13:56:47 -0400 | [diff] [blame] | 287 | "android.hardware.boot@1.2", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 288 | ], |
Yifan Hong | 2969290 | 2020-03-26 12:47:05 -0700 | [diff] [blame] | 289 | header_libs: [ |
| 290 | "avb_headers", |
| 291 | ], |
Yifan Hong | 420db9b | 2019-07-23 20:50:33 -0700 | [diff] [blame] | 292 | target: { |
| 293 | recovery: { |
David Anderson | e7ce821 | 2019-12-16 20:13:19 -0800 | [diff] [blame] | 294 | static_libs: [ |
| 295 | "libfs_mgr", |
| 296 | "libsnapshot_nobinder", |
| 297 | ], |
| 298 | exclude_static_libs: [ |
| 299 | "libfs_mgr_binder", |
| 300 | "libsnapshot", |
| 301 | ], |
Yifan Hong | 212d795 | 2020-02-04 11:08:08 -0800 | [diff] [blame] | 302 | exclude_shared_libs: [ |
Yifan Hong | d976cc5 | 2020-02-25 14:51:42 -0800 | [diff] [blame] | 303 | "libstatslog", |
Yifan Hong | 212d795 | 2020-02-04 11:08:08 -0800 | [diff] [blame] | 304 | ], |
Yifan Hong | 420db9b | 2019-07-23 20:50:33 -0700 | [diff] [blame] | 305 | }, |
| 306 | }, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | cc_library_static { |
| 310 | name: "libupdate_engine_boot_control", |
| 311 | defaults: [ |
| 312 | "ue_defaults", |
| 313 | "libupdate_engine_boot_control_exports", |
Yifan Hong | dad0af8 | 2020-02-19 17:19:49 -0800 | [diff] [blame] | 314 | "libpayload_consumer_exports", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 315 | ], |
| 316 | recovery_available: true, |
| 317 | |
| 318 | srcs: [ |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 319 | "aosp/boot_control_android.cc", |
| 320 | "aosp/cleanup_previous_update_action.cc", |
| 321 | "aosp/dynamic_partition_control_android.cc", |
| 322 | "aosp/dynamic_partition_utils.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 323 | ], |
| 324 | } |
| 325 | |
| 326 | // libupdate_engine_android (type: static_library) |
| 327 | // ======================================================== |
| 328 | // The main daemon static_library used in Android (non-Brillo). This only has a |
| 329 | // loop to apply payloads provided by the upper layer via a Binder interface. |
| 330 | cc_defaults { |
| 331 | name: "libupdate_engine_android_exports", |
| 332 | defaults: [ |
| 333 | "ue_defaults", |
| 334 | "libpayload_consumer_exports", |
| 335 | "libupdate_engine_boot_control_exports", |
| 336 | ], |
| 337 | |
| 338 | static_libs: [ |
Tianjie | 838793d | 2021-01-14 22:05:13 -0800 | [diff] [blame] | 339 | "libavb", |
| 340 | "libavb_user", |
Yifan Hong | 126d13e | 2020-09-21 19:50:06 -0700 | [diff] [blame] | 341 | "gkiprops", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 342 | "libpayload_consumer", |
| 343 | "libupdate_engine_boot_control", |
Tianjie | 838793d | 2021-01-14 22:05:13 -0800 | [diff] [blame] | 344 | "PlatformProperties", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 345 | ], |
| 346 | shared_libs: [ |
Mohammad Samiul Islam | 24a8279 | 2021-02-12 16:52:36 +0000 | [diff] [blame] | 347 | "apex_aidl_interface-cpp", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 348 | "libandroid_net", |
| 349 | "libbase", |
| 350 | "libbinder", |
| 351 | "libbinderwrapper", |
| 352 | "libbootloader_message", |
| 353 | "libbrillo-binder", |
| 354 | "libcurl", |
| 355 | "libcutils", |
Jeongik Cha | 95f89e9 | 2021-01-26 22:33:11 +0900 | [diff] [blame] | 356 | "libupdate_engine_stable-V1-cpp", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 357 | "liblog", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 358 | "libssl", |
Tianjie Xu | 75cc9f2 | 2019-08-02 14:53:38 -0700 | [diff] [blame] | 359 | "libstatslog", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 360 | "libutils", |
| 361 | ], |
Nikita Ioffe | aedfef3 | 2021-04-28 13:54:14 +0100 | [diff] [blame] | 362 | whole_static_libs: [ |
| 363 | "com.android.sysprop.apex", |
| 364 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | cc_library_static { |
| 368 | name: "libupdate_engine_android", |
| 369 | defaults: [ |
| 370 | "ue_defaults", |
| 371 | "libupdate_engine_android_exports", |
| 372 | ], |
| 373 | |
| 374 | // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 375 | // out of the DBus interface. |
| 376 | include_dirs: ["external/cros/system_api/dbus"], |
| 377 | |
| 378 | aidl: { |
| 379 | local_include_dirs: ["binder_bindings"], |
| 380 | export_aidl_headers: true, |
| 381 | }, |
| 382 | |
| 383 | srcs: [ |
| 384 | ":libupdate_engine_aidl", |
Amin Hassani | 538bd59 | 2020-11-04 20:46:08 -0800 | [diff] [blame] | 385 | "common/system_state.cc", |
Mohammad Samiul Islam | 24a8279 | 2021-02-12 16:52:36 +0000 | [diff] [blame] | 386 | "aosp/apex_handler_android.cc", |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 387 | "aosp/binder_service_android.cc", |
| 388 | "aosp/binder_service_stable_android.cc", |
| 389 | "aosp/daemon_android.cc", |
| 390 | "aosp/daemon_state_android.cc", |
| 391 | "aosp/hardware_android.cc", |
| 392 | "aosp/logging_android.cc", |
| 393 | "aosp/network_selector_android.cc", |
| 394 | "aosp/update_attempter_android.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 395 | "certificate_checker.cc", |
Amin Hassani | 538bd59 | 2020-11-04 20:46:08 -0800 | [diff] [blame] | 396 | "download_action.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 397 | "libcurl_http_fetcher.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 398 | "metrics_utils.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 399 | "update_boot_flags_action.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 400 | ], |
| 401 | } |
| 402 | |
| 403 | // update_engine (type: executable) |
| 404 | // ======================================================== |
| 405 | // update_engine daemon. |
| 406 | cc_binary { |
| 407 | name: "update_engine", |
| 408 | defaults: [ |
| 409 | "ue_defaults", |
| 410 | "libupdate_engine_android_exports", |
| 411 | ], |
| 412 | |
| 413 | static_libs: ["libupdate_engine_android"], |
Tao Bao | 1e1c86c | 2019-04-18 10:48:32 -0700 | [diff] [blame] | 414 | required: [ |
| 415 | "cacerts_google", |
Tianjie Xu | be4ea23 | 2019-10-15 18:08:31 -0700 | [diff] [blame] | 416 | "otacerts", |
Tao Bao | 1e1c86c | 2019-04-18 10:48:32 -0700 | [diff] [blame] | 417 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 418 | |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 419 | srcs: ["main.cc", "aosp/metrics_reporter_android.cc"], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 420 | init_rc: ["update_engine.rc"], |
| 421 | } |
| 422 | |
| 423 | // update_engine_sideload (type: executable) |
| 424 | // ======================================================== |
| 425 | // A binary executable equivalent to update_engine daemon that installs an update |
| 426 | // from a local file directly instead of running in the background. Used in |
| 427 | // recovery image. |
| 428 | cc_binary { |
| 429 | name: "update_engine_sideload", |
| 430 | defaults: [ |
| 431 | "ue_defaults", |
| 432 | "update_metadata-protos_exports", |
| 433 | "libupdate_engine_boot_control_exports", |
| 434 | "libpayload_consumer_exports", |
| 435 | ], |
| 436 | recovery: true, |
| 437 | |
| 438 | cflags: ["-D_UE_SIDELOAD"], |
| 439 | // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 440 | // out of the DBus interface. |
| 441 | include_dirs: ["external/cros/system_api/dbus"], |
Elliott Hughes | 88f3c8c | 2021-04-22 13:47:21 -0700 | [diff] [blame] | 442 | header_libs: ["libgtest_prod_headers"], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 443 | |
| 444 | srcs: [ |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 445 | "aosp/hardware_android.cc", |
| 446 | "aosp/logging_android.cc", |
| 447 | "aosp/sideload_main.cc", |
| 448 | "aosp/update_attempter_android.cc", |
| 449 | "common/metrics_reporter_stub.cc", |
| 450 | "common/network_selector_stub.cc", |
Amin Hassani | 538bd59 | 2020-11-04 20:46:08 -0800 | [diff] [blame] | 451 | "common/system_state.cc", |
| 452 | "download_action.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 453 | "metrics_utils.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 454 | "update_boot_flags_action.cc", |
| 455 | "update_status_utils.cc", |
| 456 | ], |
| 457 | |
| 458 | // Use commonly used shared libraries. libprotobuf-cpp-lite.so is filtered out, |
| 459 | // as it doesn't look beneficial to be installed separately due to its size. Note |
| 460 | // that we explicitly request their recovery variants, so that the expected files |
| 461 | // will be used and installed. |
| 462 | shared_libs: [ |
| 463 | "libbase", |
| 464 | "liblog", |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 465 | "liblz4", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 466 | ], |
| 467 | static_libs: [ |
| 468 | "libpayload_consumer", |
| 469 | "libupdate_engine_boot_control", |
| 470 | "update_metadata-protos", |
| 471 | |
| 472 | // We add the static versions of the shared libraries that are not installed to |
| 473 | // recovery image due to size concerns. Need to include all the static library |
| 474 | // dependencies of these static libraries. |
Yifan Hong | 126d13e | 2020-09-21 19:50:06 -0700 | [diff] [blame] | 475 | "gkiprops", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 476 | "libevent", |
| 477 | "libmodpb64", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 478 | "libprotobuf-cpp-lite", |
| 479 | "libbrillo-stream", |
| 480 | "libbrillo", |
| 481 | "libchrome", |
| 482 | ], |
| 483 | target: { |
| 484 | recovery: { |
| 485 | exclude_shared_libs: [ |
| 486 | "libprotobuf-cpp-lite", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 487 | "libbrillo-stream", |
| 488 | "libbrillo", |
| 489 | "libchrome", |
| 490 | ], |
| 491 | }, |
| 492 | }, |
| 493 | |
Tao Bao | 1e1c86c | 2019-04-18 10:48:32 -0700 | [diff] [blame] | 494 | required: [ |
Tianjie Xu | be4ea23 | 2019-10-15 18:08:31 -0700 | [diff] [blame] | 495 | "otacerts.recovery", |
Tao Bao | 1e1c86c | 2019-04-18 10:48:32 -0700 | [diff] [blame] | 496 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 497 | } |
| 498 | |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 499 | // update_engine_client (type: executable) |
| 500 | // ======================================================== |
| 501 | // update_engine console client. |
| 502 | cc_binary { |
| 503 | name: "update_engine_client", |
| 504 | defaults: ["ue_defaults"], |
| 505 | |
| 506 | // TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 507 | // out of the DBus interface. |
| 508 | include_dirs: ["external/cros/system_api/dbus"], |
| 509 | |
| 510 | shared_libs: [ |
| 511 | "libbinder", |
| 512 | "libbinderwrapper", |
| 513 | "libbrillo-binder", |
| 514 | "libutils", |
| 515 | ], |
| 516 | |
| 517 | aidl: { |
| 518 | local_include_dirs: ["binder_bindings"], |
| 519 | }, |
| 520 | |
| 521 | srcs: [ |
| 522 | ":libupdate_engine_aidl", |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 523 | "aosp/update_engine_client_android.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 524 | "common/error_code_utils.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 525 | "update_status_utils.cc", |
| 526 | ], |
| 527 | } |
| 528 | |
| 529 | // libpayload_generator (type: static_library) |
| 530 | // ======================================================== |
| 531 | // server-side code. This is used for delta_generator and unittests but not |
| 532 | // for any client code. |
| 533 | cc_defaults { |
| 534 | name: "libpayload_generator_exports", |
| 535 | defaults: [ |
| 536 | "libpayload_consumer_exports", |
| 537 | "update_metadata-protos_exports", |
Kelvin Zhang | 446989a | 2021-12-08 13:49:07 -0800 | [diff] [blame] | 538 | "erofs-utils_export_defaults", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 539 | ], |
| 540 | |
Tianjie | 37ae856 | 2020-03-25 15:16:01 -0700 | [diff] [blame] | 541 | header_libs: [ |
| 542 | "bootimg_headers", |
| 543 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 544 | static_libs: [ |
| 545 | "libavb", |
| 546 | "libbrotli", |
| 547 | "libbsdiff", |
| 548 | "libdivsufsort", |
| 549 | "libdivsufsort64", |
| 550 | "liblzma", |
| 551 | "libpayload_consumer", |
| 552 | "libpuffdiff", |
Tianjie | a69cfe2 | 2021-08-22 23:28:44 -0700 | [diff] [blame] | 553 | "libzucchini", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 554 | "libverity_tree", |
| 555 | "update_metadata-protos", |
Kelvin Zhang | eb8703b | 2020-12-10 14:17:21 -0500 | [diff] [blame] | 556 | "libpayload_extent_utils", |
Kelvin Zhang | b93055f | 2021-02-03 14:22:35 -0500 | [diff] [blame] | 557 | "libcow_size_estimator", |
Kelvin Zhang | 446989a | 2021-12-08 13:49:07 -0800 | [diff] [blame] | 558 | "liberofs", |
| 559 | "lz4diff-protos", |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 560 | "liblz4diff", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 561 | ], |
| 562 | shared_libs: [ |
| 563 | "libbase", |
| 564 | "libext2fs", |
Kelvin Zhang | 446989a | 2021-12-08 13:49:07 -0800 | [diff] [blame] | 565 | // LZ4 has to be a shared lib, as we want to override it with |
| 566 | // LD_LIBRARY_PRELOAD later |
| 567 | "liblz4", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 568 | ], |
| 569 | } |
| 570 | |
| 571 | cc_library_static { |
David Anderson | c1c9305 | 2020-08-26 18:22:09 +0000 | [diff] [blame] | 572 | name: "libpayload_extent_ranges", |
| 573 | defaults: [ |
| 574 | "ue_defaults", |
| 575 | ], |
| 576 | host_supported: true, |
Kelvin Zhang | 9b10dba | 2020-09-25 17:09:11 -0400 | [diff] [blame] | 577 | recovery_available: true, |
David Anderson | c1c9305 | 2020-08-26 18:22:09 +0000 | [diff] [blame] | 578 | srcs: [ |
| 579 | "payload_generator/extent_ranges.cc", |
| 580 | ], |
| 581 | static_libs: [ |
| 582 | "update_metadata-protos", |
| 583 | ], |
| 584 | } |
| 585 | |
| 586 | cc_library_static { |
Kelvin Zhang | b93055f | 2021-02-03 14:22:35 -0500 | [diff] [blame] | 587 | name: "libcow_size_estimator", |
| 588 | defaults: [ |
| 589 | "ue_defaults", |
| 590 | "update_metadata-protos_exports" |
| 591 | ], |
| 592 | host_supported: true, |
| 593 | recovery_available: true, |
| 594 | srcs: [ |
| 595 | "payload_generator/cow_size_estimator.cc", |
| 596 | ], |
| 597 | static_libs: [ |
| 598 | "update_metadata-protos", |
| 599 | "libbase", |
| 600 | "libsnapshot_cow", |
| 601 | "libcow_operation_convert", |
| 602 | ], |
| 603 | } |
| 604 | |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 605 | cc_defaults { |
| 606 | name: "liblz4diff_defaults", |
| 607 | static_libs: [ |
| 608 | "lz4diff-protos", |
| 609 | "update_metadata-protos", |
| 610 | "libssl", |
| 611 | "libbsdiff", |
| 612 | "libpuffdiff", |
| 613 | ], |
| 614 | shared_libs: [ |
| 615 | "liblz4", |
Kelvin Zhang | 893b3a1 | 2021-12-30 12:28:53 -0800 | [diff] [blame] | 616 | ], |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 617 | } |
| 618 | |
| 619 | cc_library_static { |
| 620 | name: "liblz4diff", |
| 621 | host_supported: true, |
| 622 | defaults: ["ue_defaults", "liblz4diff_defaults"], |
| 623 | srcs: [ |
Kelvin Zhang | 893b3a1 | 2021-12-30 12:28:53 -0800 | [diff] [blame] | 624 | "lz4diff/lz4diff.cc", |
Kelvin Zhang | 4eae81e | 2021-12-09 17:07:17 -0800 | [diff] [blame] | 625 | "lz4diff/lz4diff_compress.cc", |
| 626 | ], |
| 627 | } |
| 628 | |
| 629 | cc_library_static { |
| 630 | name: "liblz4patch", |
| 631 | host_supported: true, |
| 632 | recovery_available: true, |
| 633 | defaults: ["ue_defaults"], |
| 634 | static_libs: [ |
| 635 | "lz4diff-protos", |
| 636 | "update_metadata-protos", |
| 637 | "libssl", |
| 638 | "libbspatch", |
| 639 | "libpuffpatch", |
| 640 | ], |
| 641 | shared_libs: [ |
| 642 | "liblz4", |
| 643 | ], |
| 644 | srcs: [ |
| 645 | "lz4diff/lz4patch.cc", |
| 646 | "lz4diff/lz4diff_compress.cc", |
| 647 | ], |
| 648 | } |
| 649 | |
Kelvin Zhang | 35cff4f | 2021-12-08 16:06:00 -0800 | [diff] [blame^] | 650 | cc_binary_host { |
| 651 | name: "lz4diff", |
| 652 | defaults: [ |
| 653 | "ue_defaults", |
| 654 | "libpayload_generator_exports", |
| 655 | ], |
| 656 | static_libs: [ |
| 657 | "libpayload_generator", |
| 658 | "liblz4diff", |
| 659 | "liblz4patch", |
| 660 | ], |
| 661 | srcs: [ |
| 662 | "lz4diff/lz4diff_main.cc", |
| 663 | ], |
| 664 | } |
| 665 | |
Kelvin Zhang | b93055f | 2021-02-03 14:22:35 -0500 | [diff] [blame] | 666 | cc_library_static { |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 667 | name: "libpayload_generator", |
| 668 | defaults: [ |
| 669 | "ue_defaults", |
| 670 | "libpayload_generator_exports", |
| 671 | ], |
| 672 | host_supported: true, |
| 673 | |
| 674 | srcs: [ |
Amin Hassani | 538bd59 | 2020-11-04 20:46:08 -0800 | [diff] [blame] | 675 | "common/system_state.cc", |
| 676 | "download_action.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 677 | "payload_generator/ab_generator.cc", |
| 678 | "payload_generator/annotated_operation.cc", |
| 679 | "payload_generator/blob_file_writer.cc", |
| 680 | "payload_generator/block_mapping.cc", |
| 681 | "payload_generator/boot_img_filesystem.cc", |
| 682 | "payload_generator/bzip.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 683 | "payload_generator/deflate_utils.cc", |
| 684 | "payload_generator/delta_diff_generator.cc", |
| 685 | "payload_generator/delta_diff_utils.cc", |
| 686 | "payload_generator/ext2_filesystem.cc", |
Kelvin Zhang | 446989a | 2021-12-08 13:49:07 -0800 | [diff] [blame] | 687 | "payload_generator/erofs_filesystem.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 688 | "payload_generator/extent_ranges.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 689 | "payload_generator/full_update_generator.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 690 | "payload_generator/mapfile_filesystem.cc", |
Tianjie | e9156ec | 2020-08-11 11:13:54 -0700 | [diff] [blame] | 691 | "payload_generator/merge_sequence_generator.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 692 | "payload_generator/payload_file.cc", |
| 693 | "payload_generator/payload_generation_config_android.cc", |
| 694 | "payload_generator/payload_generation_config.cc", |
Amin Hassani | 7982100 | 2019-05-06 17:40:49 -0700 | [diff] [blame] | 695 | "payload_generator/payload_properties.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 696 | "payload_generator/payload_signer.cc", |
| 697 | "payload_generator/raw_filesystem.cc", |
| 698 | "payload_generator/squashfs_filesystem.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 699 | "payload_generator/xz_android.cc", |
| 700 | ], |
| 701 | } |
| 702 | |
| 703 | // delta_generator (type: executable) |
| 704 | // ======================================================== |
| 705 | // server-side delta generator. |
| 706 | cc_binary_host { |
| 707 | name: "delta_generator", |
| 708 | defaults: [ |
| 709 | "ue_defaults", |
| 710 | "libpayload_generator_exports", |
| 711 | "libpayload_consumer_exports", |
| 712 | ], |
| 713 | |
| 714 | static_libs: [ |
| 715 | "libavb_host_sysdeps", |
| 716 | "libpayload_consumer", |
| 717 | "libpayload_generator", |
| 718 | ], |
| 719 | |
| 720 | srcs: ["payload_generator/generate_delta_main.cc"], |
| 721 | } |
| 722 | |
| 723 | cc_test { |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 724 | host_supported: true, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 725 | name: "ue_unittest_delta_generator", |
| 726 | defaults: [ |
| 727 | "ue_defaults", |
| 728 | "libpayload_generator_exports", |
| 729 | "libpayload_consumer_exports", |
| 730 | ], |
| 731 | |
| 732 | static_libs: [ |
| 733 | "libpayload_consumer", |
| 734 | "libpayload_generator", |
| 735 | ], |
| 736 | |
| 737 | srcs: ["payload_generator/generate_delta_main.cc"], |
| 738 | |
| 739 | gtest: false, |
| 740 | stem: "delta_generator", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 741 | } |
| 742 | |
| 743 | // test_http_server (type: executable) |
| 744 | // ======================================================== |
| 745 | // Test HTTP Server. |
| 746 | cc_test { |
| 747 | name: "test_http_server", |
| 748 | defaults: ["ue_defaults"], |
| 749 | srcs: [ |
| 750 | "common/http_common.cc", |
| 751 | "test_http_server.cc", |
| 752 | ], |
| 753 | |
| 754 | gtest: false, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 755 | } |
| 756 | |
| 757 | // test_subprocess (type: executable) |
| 758 | // ======================================================== |
| 759 | // Test helper subprocess program. |
| 760 | cc_test { |
| 761 | name: "test_subprocess", |
| 762 | defaults: ["ue_defaults"], |
| 763 | srcs: ["test_subprocess.cc"], |
| 764 | |
| 765 | gtest: false, |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 766 | } |
| 767 | |
| 768 | // Public keys for unittests. |
| 769 | // ======================================================== |
| 770 | genrule { |
| 771 | name: "ue_unittest_keys", |
| 772 | cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &&" + |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 773 | "openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" + |
Tianjie Xu | 7bbe015 | 2019-10-09 18:11:15 -0700 | [diff] [blame] | 774 | "openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096.pub.pem) &&" + |
| 775 | "openssl pkey -in $(location unittest_key_EC.pem) -pubout -out $(location unittest_key_EC.pub.pem)", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 776 | srcs: [ |
| 777 | "unittest_key.pem", |
| 778 | "unittest_key2.pem", |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 779 | "unittest_key_RSA4096.pem", |
Tianjie Xu | 7bbe015 | 2019-10-09 18:11:15 -0700 | [diff] [blame] | 780 | "unittest_key_EC.pem", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 781 | ], |
| 782 | out: [ |
| 783 | "unittest_key.pub.pem", |
| 784 | "unittest_key2.pub.pem", |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 785 | "unittest_key_RSA4096.pub.pem", |
Tianjie Xu | 7bbe015 | 2019-10-09 18:11:15 -0700 | [diff] [blame] | 786 | "unittest_key_EC.pub.pem", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 787 | ], |
| 788 | } |
| 789 | |
| 790 | // Sample images for unittests. |
| 791 | // ======================================================== |
| 792 | // Extract sample image from the compressed sample_images.tar.bz2 file used by |
| 793 | // the unittests. |
| 794 | genrule { |
| 795 | name: "ue_unittest_disk_imgs", |
| 796 | cmd: "tar -jxf $(in) -C $(genDir)/gen disk_ext2_1k.img disk_ext2_4k.img disk_ext2_4k_empty.img disk_ext2_unittest.img", |
| 797 | srcs: ["sample_images/sample_images.tar.bz2"], |
| 798 | out: [ |
| 799 | "gen/disk_ext2_1k.img", |
| 800 | "gen/disk_ext2_4k.img", |
| 801 | "gen/disk_ext2_4k_empty.img", |
| 802 | "gen/disk_ext2_unittest.img", |
| 803 | ], |
| 804 | } |
| 805 | |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 806 | genrule { |
| 807 | name: "ue_unittest_erofs_imgs", |
Kelvin Zhang | 893b3a1 | 2021-12-30 12:28:53 -0800 | [diff] [blame] | 808 | cmd: "$(in) $(location mkfs.erofs) $(location gen/erofs_empty.img) && " + |
| 809 | "$(in) $(location mkfs.erofs) $(location gen/erofs.img) $(location delta_generator) && " + |
| 810 | "$(in) $(location mkfs.erofs) $(location gen/erofs_new.img) $(location delta_generator) lz4hc,7", |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 811 | srcs: ["sample_images/generate_test_erofs_images.sh"], |
| 812 | out: [ |
| 813 | "gen/erofs.img", |
Kelvin Zhang | 893b3a1 | 2021-12-30 12:28:53 -0800 | [diff] [blame] | 814 | "gen/erofs_new.img", |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 815 | "gen/erofs_empty.img", |
| 816 | ], |
| 817 | tools: [ |
| 818 | "mkfs.erofs", |
| 819 | "delta_generator", |
| 820 | ], |
| 821 | } |
| 822 | |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 823 | filegroup { |
| 824 | name: "update_engine_host_unittest_srcs", |
| 825 | srcs: [ |
| 826 | "common/action_pipe_unittest.cc", |
| 827 | "common/action_processor_unittest.cc", |
| 828 | "common/action_unittest.cc", |
| 829 | "common/cow_operation_convert_unittest.cc", |
| 830 | "common/cpu_limiter_unittest.cc", |
| 831 | "common/fake_prefs.cc", |
| 832 | "common/file_fetcher_unittest.cc", |
| 833 | "common/hash_calculator_unittest.cc", |
| 834 | "common/hwid_override_unittest.cc", |
| 835 | "common/metrics_reporter_stub.cc", |
| 836 | "common/mock_http_fetcher.cc", |
| 837 | "common/prefs_unittest.cc", |
| 838 | "common/terminator_unittest.cc", |
| 839 | "common/test_utils.cc", |
Kelvin Zhang | 5562403 | 2021-12-20 12:13:24 -0800 | [diff] [blame] | 840 | "lz4diff/lz4diff_compress_unittest.cc", |
Kelvin Zhang | 893b3a1 | 2021-12-30 12:28:53 -0800 | [diff] [blame] | 841 | "lz4diff/lz4diff_unittest.cc", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 842 | "payload_generator/ab_generator_unittest.cc", |
| 843 | "payload_generator/blob_file_writer_unittest.cc", |
| 844 | "payload_generator/block_mapping_unittest.cc", |
| 845 | "payload_generator/boot_img_filesystem_unittest.cc", |
| 846 | "payload_generator/deflate_utils_unittest.cc", |
| 847 | "payload_generator/delta_diff_utils_unittest.cc", |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 848 | "payload_generator/erofs_filesystem_unittest.cc", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 849 | "payload_generator/ext2_filesystem_unittest.cc", |
| 850 | "payload_generator/extent_ranges_unittest.cc", |
| 851 | "payload_generator/extent_utils_unittest.cc", |
| 852 | "payload_generator/fake_filesystem.cc", |
| 853 | "payload_generator/full_update_generator_unittest.cc", |
| 854 | "payload_generator/mapfile_filesystem_unittest.cc", |
| 855 | "payload_generator/merge_sequence_generator_unittest.cc", |
| 856 | "payload_generator/payload_file_unittest.cc", |
| 857 | "payload_generator/payload_generation_config_android_unittest.cc", |
| 858 | "payload_generator/payload_generation_config_unittest.cc", |
| 859 | "payload_generator/payload_properties_unittest.cc", |
| 860 | "payload_generator/payload_signer_unittest.cc", |
| 861 | "payload_generator/squashfs_filesystem_unittest.cc", |
| 862 | "payload_generator/zip_unittest.cc", |
| 863 | "testrunner.cc", |
| 864 | ], |
| 865 | } |
| 866 | |
| 867 | cc_test_host { |
| 868 | name: "update_engine_host_unittests", |
| 869 | defaults: [ |
| 870 | "ue_defaults", |
| 871 | "libpayload_generator_exports", |
| 872 | ], |
| 873 | strip: { |
| 874 | none: true, |
| 875 | }, |
| 876 | cflags: [ |
| 877 | "-g3", |
| 878 | ], |
| 879 | srcs: [":update_engine_host_unittest_srcs"], |
| 880 | data: [ |
| 881 | ":ue_unittest_delta_generator", |
| 882 | ":ue_unittest_disk_imgs", |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 883 | ":ue_unittest_erofs_imgs", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 884 | ":ue_unittest_keys", |
| 885 | "otacerts.zip", |
| 886 | "unittest_key.pem", |
| 887 | "unittest_key2.pem", |
| 888 | "unittest_key_RSA4096.pem", |
| 889 | "unittest_key_EC.pem", |
| 890 | "update_engine.conf", |
| 891 | ], |
| 892 | static_libs: [ |
| 893 | "libcurl", |
| 894 | "libgmock", |
| 895 | "libpayload_generator", |
| 896 | ], |
| 897 | } |
| 898 | |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 899 | // update_engine_unittests (type: executable) |
| 900 | // ======================================================== |
| 901 | // Main unittest file. |
| 902 | cc_test { |
| 903 | name: "update_engine_unittests", |
| 904 | defaults: [ |
| 905 | "ue_defaults", |
| 906 | "libpayload_generator_exports", |
| 907 | "libupdate_engine_android_exports", |
| 908 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 909 | |
| 910 | static_libs: [ |
| 911 | "libpayload_generator", |
| 912 | "libbrillo-test-helpers", |
| 913 | "libgmock", |
| 914 | "libchrome_test_helpers", |
| 915 | "libupdate_engine_android", |
Tianjie Xu | 173e619 | 2019-12-10 10:56:01 -0800 | [diff] [blame] | 916 | "libdm", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 917 | ], |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 918 | |
Yifan Hong | 87ea73f | 2019-09-12 13:07:37 -0700 | [diff] [blame] | 919 | header_libs: [ |
| 920 | "libstorage_literals_headers", |
| 921 | ], |
| 922 | |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 923 | data: [ |
Tao Bao | 9456b6f | 2019-04-29 18:14:58 -0700 | [diff] [blame] | 924 | ":test_http_server", |
| 925 | ":test_subprocess", |
| 926 | ":ue_unittest_delta_generator", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 927 | ":ue_unittest_disk_imgs", |
Kelvin Zhang | 759e8b9 | 2021-12-21 16:46:58 -0800 | [diff] [blame] | 928 | ":ue_unittest_erofs_imgs", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 929 | ":ue_unittest_keys", |
Tianjie Xu | 7a78d63 | 2019-10-08 16:32:39 -0700 | [diff] [blame] | 930 | "otacerts.zip", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 931 | "unittest_key.pem", |
| 932 | "unittest_key2.pem", |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 933 | "unittest_key_RSA4096.pem", |
Tianjie Xu | 7bbe015 | 2019-10-09 18:11:15 -0700 | [diff] [blame] | 934 | "unittest_key_EC.pem", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 935 | "update_engine.conf", |
| 936 | ], |
| 937 | |
Tao Bao | 9456b6f | 2019-04-29 18:14:58 -0700 | [diff] [blame] | 938 | // We cannot use the default generated AndroidTest.xml because of the use of helper modules |
| 939 | // (i.e. test_http_server, test_subprocess, ue_unittest_delta_generator). |
| 940 | test_config: "test_config.xml", |
| 941 | test_suites: ["device-tests"], |
| 942 | |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 943 | srcs: [ |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 944 | ":update_engine_host_unittest_srcs", |
Mohammad Samiul Islam | 24a8279 | 2021-02-12 16:52:36 +0000 | [diff] [blame] | 945 | "aosp/apex_handler_android_unittest.cc", |
Kelvin Zhang | b4b95c2 | 2021-04-05 15:56:26 -0400 | [diff] [blame] | 946 | "aosp/cleanup_previous_update_action_unittest.cc", |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 947 | "aosp/dynamic_partition_control_android_unittest.cc", |
Kelvin Zhang | 3fe4964 | 2021-10-04 15:35:02 -0700 | [diff] [blame] | 948 | "aosp/update_attempter_android_integration_test.cc", |
Amin Hassani | ec7bc11 | 2020-10-29 16:47:58 -0700 | [diff] [blame] | 949 | "aosp/update_attempter_android_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 950 | "certificate_checker_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 951 | "common/http_fetcher_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 952 | "common/proxy_resolver_unittest.cc", |
| 953 | "common/subprocess_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 954 | "common/utils_unittest.cc", |
Kelvin Zhang | 4e93cf1 | 2021-09-13 16:03:24 -0700 | [diff] [blame] | 955 | "download_action_android_unittest.cc", |
| 956 | "libcurl_http_fetcher_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 957 | "payload_consumer/bzip_extent_writer_unittest.cc", |
| 958 | "payload_consumer/cached_file_descriptor_unittest.cc", |
Kelvin Zhang | 46d6c49 | 2021-04-26 17:51:25 -0400 | [diff] [blame] | 959 | "payload_consumer/cow_writer_file_descriptor_unittest.cc", |
Tianjie Xu | 7a78d63 | 2019-10-08 16:32:39 -0700 | [diff] [blame] | 960 | "payload_consumer/certificate_parser_android_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 961 | "payload_consumer/delta_performer_integration_test.cc", |
| 962 | "payload_consumer/delta_performer_unittest.cc", |
| 963 | "payload_consumer/extent_reader_unittest.cc", |
| 964 | "payload_consumer/extent_writer_unittest.cc", |
Kelvin Zhang | c5803b7 | 2021-09-02 09:06:16 -0700 | [diff] [blame] | 965 | "payload_consumer/extent_map_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 966 | "payload_consumer/fake_file_descriptor.cc", |
| 967 | "payload_consumer/file_descriptor_utils_unittest.cc", |
| 968 | "payload_consumer/file_writer_unittest.cc", |
| 969 | "payload_consumer/filesystem_verifier_action_unittest.cc", |
Amin Hassani | 2379503 | 2020-11-24 14:38:55 -0800 | [diff] [blame] | 970 | "payload_consumer/install_plan_unittest.cc", |
Kelvin Zhang | 40d9666 | 2021-02-24 14:21:29 -0500 | [diff] [blame] | 971 | "payload_consumer/install_operation_executor_unittest.cc", |
Tianjie | 99d570d | 2020-06-04 14:57:19 -0700 | [diff] [blame] | 972 | "payload_consumer/partition_update_generator_android_unittest.cc", |
Kelvin Zhang | 4e93cf1 | 2021-09-13 16:03:24 -0700 | [diff] [blame] | 973 | "payload_consumer/partition_writer_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 974 | "payload_consumer/postinstall_runner_action_unittest.cc", |
Kelvin Zhang | 4e93cf1 | 2021-09-13 16:03:24 -0700 | [diff] [blame] | 975 | "payload_consumer/snapshot_extent_writer_unittest.cc", |
| 976 | "payload_consumer/vabc_partition_writer_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 977 | "payload_consumer/verity_writer_android_unittest.cc", |
Kelvin Zhang | 4e93cf1 | 2021-09-13 16:03:24 -0700 | [diff] [blame] | 978 | "payload_consumer/xor_extent_writer_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 979 | "payload_consumer/xz_extent_writer_unittest.cc", |
Jae Hoon Kim | 916af85 | 2019-08-01 17:45:30 -0700 | [diff] [blame] | 980 | "update_status_utils_unittest.cc", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 981 | ], |
| 982 | } |
| 983 | |
| 984 | // Brillo update payload generation script |
| 985 | // ======================================================== |
Martin Stjernholm | 18e9f3c | 2020-09-08 13:56:59 +0100 | [diff] [blame] | 986 | sh_binary { |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 987 | name: "brillo_update_payload", |
| 988 | device_supported: false, |
| 989 | host_supported: true, |
| 990 | |
Martin Stjernholm | 18e9f3c | 2020-09-08 13:56:59 +0100 | [diff] [blame] | 991 | src: "scripts/brillo_update_payload", |
Dan Willemsen | f5a904e | 2018-10-23 01:02:44 -0700 | [diff] [blame] | 992 | required: [ |
| 993 | "delta_generator", |
| 994 | "shflags", |
| 995 | "simg2img", |
| 996 | ], |
| 997 | |
| 998 | target: { |
| 999 | darwin: { |
| 1000 | enabled: false, |
| 1001 | }, |
| 1002 | }, |
Colin Cross | 606913a | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 1003 | } |
Yifan Hong | d51738c | 2020-07-23 17:06:25 -0700 | [diff] [blame] | 1004 | |
| 1005 | // update_engine header library |
| 1006 | cc_library_headers { |
| 1007 | name: "libupdate_engine_headers", |
Yifan Hong | 309c8a8 | 2020-10-06 18:31:08 -0700 | [diff] [blame] | 1008 | |
| 1009 | // This header library is available to core and product modules. |
Justin Yun | 6d121de | 2020-11-11 19:31:57 +0900 | [diff] [blame] | 1010 | product_available: true, |
Yifan Hong | 309c8a8 | 2020-10-06 18:31:08 -0700 | [diff] [blame] | 1011 | |
Yifan Hong | d51738c | 2020-07-23 17:06:25 -0700 | [diff] [blame] | 1012 | export_include_dirs: ["."], |
| 1013 | apex_available: [ |
| 1014 | "com.android.gki.*", |
David Anderson | 5e6dfe3 | 2020-09-17 15:50:33 -0700 | [diff] [blame] | 1015 | "//apex_available:platform", |
Yifan Hong | d51738c | 2020-07-23 17:06:25 -0700 | [diff] [blame] | 1016 | ], |
David Anderson | c1c9305 | 2020-08-26 18:22:09 +0000 | [diff] [blame] | 1017 | host_supported: true, |
David Anderson | 5e6dfe3 | 2020-09-17 15:50:33 -0700 | [diff] [blame] | 1018 | recovery_available: true, |
| 1019 | ramdisk_available: true, |
| 1020 | |
| 1021 | target: { |
| 1022 | darwin: { |
| 1023 | enabled: false, |
| 1024 | }, |
| 1025 | } |
Yifan Hong | d51738c | 2020-07-23 17:06:25 -0700 | [diff] [blame] | 1026 | } |
Kelvin Zhang | b93055f | 2021-02-03 14:22:35 -0500 | [diff] [blame] | 1027 | |
| 1028 | cc_binary_host { |
| 1029 | name: "cow_converter", |
| 1030 | defaults: [ |
| 1031 | "ue_defaults", |
| 1032 | "libpayload_consumer_exports", |
| 1033 | ], |
| 1034 | srcs: [ |
| 1035 | "aosp/cow_converter.cc", |
| 1036 | ], |
| 1037 | static_libs: [ |
| 1038 | "liblog", |
| 1039 | "libbrotli", |
| 1040 | "libbase", |
| 1041 | "libcow_operation_convert", |
| 1042 | "libcow_size_estimator", |
| 1043 | "libpayload_consumer", |
| 1044 | "libpayload_extent_ranges", |
| 1045 | "libpayload_extent_utils", |
| 1046 | "libsnapshot_cow", |
| 1047 | "libz", |
| 1048 | "update_metadata-protos", |
| 1049 | ], |
Elliott Hughes | 88f3c8c | 2021-04-22 13:47:21 -0700 | [diff] [blame] | 1050 | } |
Kelvin Zhang | 98001b2 | 2021-12-08 14:10:11 -0800 | [diff] [blame] | 1051 | |
| 1052 | cc_library_static { |
| 1053 | name: "lz4diff-protos", |
| 1054 | host_supported: true, |
| 1055 | ramdisk_available: true, |
| 1056 | recovery_available: true, |
| 1057 | |
| 1058 | srcs: ["lz4diff/lz4diff.proto"], |
| 1059 | cflags: [ |
| 1060 | "-Wall", |
| 1061 | "-Werror", |
| 1062 | ], |
| 1063 | proto: { |
| 1064 | canonical_path_from_root: false, |
| 1065 | export_proto_headers: true, |
| 1066 | }, |
| 1067 | } |