Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 1 | // |
Jan Monsch | cd7c913 | 2020-05-08 02:34:40 +0200 | [diff] [blame] | 2 | // Copyright (C) 2017-2020 The Android Open Source Project |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 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 | |
Bob Badour | b30c971 | 2021-02-12 14:49:55 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["external_avb_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // See: http://go/android-license-faq |
| 35 | license { |
| 36 | name: "external_avb_license", |
| 37 | visibility: [":__subpackages__"], |
| 38 | license_kinds: [ |
| 39 | "SPDX-license-identifier-Apache-2.0", |
| 40 | "SPDX-license-identifier-BSD", |
| 41 | "SPDX-license-identifier-MIT", |
| 42 | ], |
| 43 | license_text: [ |
| 44 | "LICENSE", |
| 45 | ], |
| 46 | } |
| 47 | |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 48 | subdirs = [ |
| 49 | "test", |
| 50 | "tools", |
| 51 | ] |
Bryan Henry | 99df6c8 | 2018-10-25 15:00:43 -0700 | [diff] [blame] | 52 | |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 53 | cc_defaults { |
| 54 | name: "avb_defaults", |
| 55 | cflags: [ |
| 56 | "-D_FILE_OFFSET_BITS=64", |
| 57 | "-D_POSIX_C_SOURCE=199309L", |
| 58 | "-Wa,--noexecstack", |
| 59 | "-Werror", |
| 60 | "-Wall", |
| 61 | "-Wextra", |
| 62 | "-Wformat=2", |
David Zeuthen | 047ecf7 | 2017-06-28 14:10:55 -0400 | [diff] [blame] | 63 | "-Wmissing-prototypes", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 64 | "-Wno-psabi", |
| 65 | "-Wno-unused-parameter", |
Yi Kong | ed46d64 | 2018-01-03 11:52:56 -0800 | [diff] [blame] | 66 | "-Wno-format", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 67 | "-ffunction-sections", |
| 68 | "-fstack-protector-strong", |
| 69 | "-g", |
| 70 | "-DAVB_ENABLE_DEBUG", |
| 71 | "-DAVB_COMPILATION", |
| 72 | ], |
| 73 | cppflags: [ |
| 74 | "-Wnon-virtual-dtor", |
| 75 | "-fno-strict-aliasing", |
| 76 | ], |
| 77 | ldflags: [ |
| 78 | "-Wl,--gc-sections", |
| 79 | "-rdynamic", |
| 80 | ], |
| 81 | target: { |
| 82 | darwin: { |
| 83 | enabled: false, |
| 84 | }, |
| 85 | }, |
| 86 | } |
| 87 | |
| 88 | cc_defaults { |
| 89 | name: "avb_sources", |
| 90 | srcs: [ |
| 91 | "libavb/avb_chain_partition_descriptor.c", |
Lonnie Liu | 97740e5 | 2017-11-09 11:16:15 -0800 | [diff] [blame] | 92 | "libavb/avb_cmdline.c", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 93 | "libavb/avb_crc32.c", |
| 94 | "libavb/avb_crypto.c", |
| 95 | "libavb/avb_descriptor.c", |
| 96 | "libavb/avb_footer.c", |
| 97 | "libavb/avb_hash_descriptor.c", |
| 98 | "libavb/avb_hashtree_descriptor.c", |
| 99 | "libavb/avb_kernel_cmdline_descriptor.c", |
| 100 | "libavb/avb_property_descriptor.c", |
| 101 | "libavb/avb_rsa.c", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 102 | "libavb/avb_slot_verify.c", |
| 103 | "libavb/avb_util.c", |
| 104 | "libavb/avb_vbmeta_image.c", |
| 105 | "libavb/avb_version.c", |
| 106 | ], |
| 107 | } |
| 108 | |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 109 | cc_defaults { |
| 110 | name: "avb_crypto_ops_impl_boringssl", |
| 111 | srcs: [ |
| 112 | "libavb/boringssl/sha.c", |
| 113 | ], |
| 114 | local_include_dirs: [ |
| 115 | "libavb/boringssl", |
| 116 | ], |
| 117 | shared_libs: [ |
| 118 | "libcrypto", |
| 119 | ], |
| 120 | } |
| 121 | |
| 122 | cc_defaults { |
| 123 | name: "avb_crypto_ops_impl_sha", |
| 124 | srcs: [ |
| 125 | "libavb/sha/sha256_impl.c", |
| 126 | "libavb/sha/sha512_impl.c", |
| 127 | ], |
| 128 | local_include_dirs: [ |
| 129 | "libavb/sha", |
| 130 | ], |
| 131 | } |
| 132 | |
Alex Light | 027718c | 2019-03-07 16:44:46 -0800 | [diff] [blame] | 133 | python_binary_host { |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 134 | name: "avbtool", |
Jan Monsch | a18b2ec | 2020-04-22 11:43:35 +0200 | [diff] [blame] | 135 | srcs: ["avbtool.py"], |
Alex Light | 027718c | 2019-03-07 16:44:46 -0800 | [diff] [blame] | 136 | main: "avbtool.py", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 137 | required: ["fec"], |
Alex Light | 027718c | 2019-03-07 16:44:46 -0800 | [diff] [blame] | 138 | version: { |
| 139 | py2: { |
Jan Monsch | 13efb5f | 2020-04-22 17:34:24 +0200 | [diff] [blame] | 140 | enabled: false, |
Alex Light | 027718c | 2019-03-07 16:44:46 -0800 | [diff] [blame] | 141 | }, |
| 142 | py3: { |
Jan Monsch | 13efb5f | 2020-04-22 17:34:24 +0200 | [diff] [blame] | 143 | enabled: true, |
Bowgo Tsai | e4c67ec | 2021-01-28 13:29:01 +0800 | [diff] [blame] | 144 | embedded_launcher: true, |
Julien Desprez | 0d584b6 | 2021-01-15 17:56:56 -0800 | [diff] [blame] | 145 | }, |
| 146 | }, |
Julien Desprez | 809d269 | 2021-01-27 14:07:27 -0800 | [diff] [blame] | 147 | compile_multilib: "first", |
Alex Light | 027718c | 2019-03-07 16:44:46 -0800 | [diff] [blame] | 148 | } |
| 149 | |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 150 | python_library_host { |
| 151 | name: "aftl_proto", |
| 152 | srcs: [ |
Jan Monsch | fd21e7b | 2020-04-18 01:33:33 +0200 | [diff] [blame] | 153 | "proto/api.proto", |
Jan Monsch | fd21e7b | 2020-04-18 01:33:33 +0200 | [diff] [blame] | 154 | "proto/crypto/sigpb/sigpb.proto", |
| 155 | "proto/crypto/keyspb/keyspb.proto", |
| 156 | "proto/trillian.proto", |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 157 | ], |
Jan Monsch | fd21e7b | 2020-04-18 01:33:33 +0200 | [diff] [blame] | 158 | proto: { |
| 159 | include_dirs: [ |
| 160 | "external/protobuf/src", |
| 161 | ], |
| 162 | local_include_dirs: [ |
| 163 | "proto", |
| 164 | ], |
| 165 | canonical_path_from_root: false, |
| 166 | }, |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 167 | version: { |
| 168 | py2: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 169 | enabled: false, |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 170 | }, |
| 171 | py3: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 172 | enabled: true, |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 173 | }, |
| 174 | }, |
| 175 | } |
| 176 | |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 177 | python_binary_host { |
| 178 | name: "aftltool", |
Jan Monsch | 5ac429e | 2019-12-11 19:04:26 +0100 | [diff] [blame] | 179 | srcs: [ |
Jan Monsch | fd21e7b | 2020-04-18 01:33:33 +0200 | [diff] [blame] | 180 | "aftltool.py", |
Jan Monsch | a18b2ec | 2020-04-22 11:43:35 +0200 | [diff] [blame] | 181 | "avbtool.py", |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 182 | ], |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 183 | libs: [ |
| 184 | "aftl_proto", |
| 185 | ], |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 186 | main: "aftltool.py", |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 187 | version: { |
| 188 | py2: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 189 | enabled: false, |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 190 | }, |
| 191 | py3: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 192 | enabled: true, |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 193 | }, |
| 194 | }, |
| 195 | } |
| 196 | |
| 197 | python_test_host { |
| 198 | name: "aftltool_test", |
| 199 | main: "aftltool_test.py", |
| 200 | srcs: [ |
Jan Monsch | fd21e7b | 2020-04-18 01:33:33 +0200 | [diff] [blame] | 201 | "aftltool.py", |
Dan Austin | 715f503 | 2020-01-08 10:18:05 -0800 | [diff] [blame] | 202 | "aftltool_test.py", |
Jan Monsch | a18b2ec | 2020-04-22 11:43:35 +0200 | [diff] [blame] | 203 | "avbtool.py", |
Jan Monsch | 5ac429e | 2019-12-11 19:04:26 +0100 | [diff] [blame] | 204 | ], |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 205 | libs: [ |
| 206 | "aftl_proto", |
| 207 | ], |
| 208 | data: [ |
Jan Monsch | 443bf32 | 2020-02-19 14:56:44 +0100 | [diff] [blame] | 209 | "test/data/**/*.*", |
Jan Monsch | 0ec6b9a | 2020-01-29 14:38:46 +0100 | [diff] [blame] | 210 | ], |
Julien Desprez | d09c6ce | 2021-01-13 11:41:00 -0800 | [diff] [blame] | 211 | test_options: { |
| 212 | unit_test: true, |
| 213 | }, |
Jan Monsch | 5ac429e | 2019-12-11 19:04:26 +0100 | [diff] [blame] | 214 | version: { |
| 215 | py2: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 216 | enabled: false, |
Jan Monsch | 5ac429e | 2019-12-11 19:04:26 +0100 | [diff] [blame] | 217 | }, |
| 218 | py3: { |
Jan Monsch | 7ec4182 | 2020-04-15 01:16:44 +0200 | [diff] [blame] | 219 | enabled: true, |
Jan Monsch | 5ac429e | 2019-12-11 19:04:26 +0100 | [diff] [blame] | 220 | }, |
| 221 | }, |
| 222 | } |
| 223 | |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 224 | // Build libavb - this is a static library that depends |
| 225 | // on only libc and doesn't drag in any other dependencies. |
| 226 | cc_library_static { |
| 227 | name: "libavb", |
| 228 | defaults: [ |
| 229 | "avb_defaults", |
| 230 | "avb_sources", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 231 | "avb_crypto_ops_impl_boringssl", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 232 | ], |
| 233 | host_supported: true, |
Inseob Kim | f1bca77 | 2021-06-14 11:53:04 +0900 | [diff] [blame^] | 234 | ramdisk_available: true, |
Jiyong Park | 44e0712 | 2018-05-24 14:07:34 +0900 | [diff] [blame] | 235 | recovery_available: true, |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 236 | header_libs: [ |
| 237 | "avb_headers", |
| 238 | ], |
| 239 | export_header_lib_headers: ["avb_headers"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 240 | target: { |
Andreas Gampe | 364a342 | 2018-12-26 11:12:11 -0800 | [diff] [blame] | 241 | linux: { |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 242 | srcs: ["libavb/avb_sysdeps_posix.c"], |
| 243 | }, |
Dan Willemsen | 34ec123 | 2017-10-02 10:41:07 -0700 | [diff] [blame] | 244 | linux_glibc: { |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 245 | cflags: ["-fno-stack-protector"], |
| 246 | }, |
| 247 | }, |
| 248 | } |
| 249 | |
| 250 | // Build libavb_user for the target - in addition to libavb, it |
| 251 | // includes libavb_ab, libavb_user and also depends on libbase and |
| 252 | // libfs_mgr. |
| 253 | cc_library_static { |
| 254 | name: "libavb_user", |
| 255 | defaults: [ |
| 256 | "avb_defaults", |
| 257 | "avb_sources", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 258 | "avb_crypto_ops_impl_boringssl", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 259 | ], |
Jiyong Park | 44e0712 | 2018-05-24 14:07:34 +0900 | [diff] [blame] | 260 | recovery_available: true, |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 261 | header_libs: [ |
| 262 | "avb_headers", |
| 263 | ], |
| 264 | export_header_lib_headers: ["avb_headers"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 265 | shared_libs: ["libbase"], |
| 266 | static_libs: ["libfs_mgr"], |
David Zeuthen | 37f5946 | 2017-09-20 15:02:32 -0400 | [diff] [blame] | 267 | cflags: [ |
| 268 | "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", |
| 269 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 270 | srcs: [ |
| 271 | "libavb/avb_sysdeps_posix.c", |
| 272 | "libavb_ab/avb_ab_flow.c", |
Bowgo Tsai | 84c610e | 2017-09-28 15:13:05 +0800 | [diff] [blame] | 273 | "libavb_user/avb_ops_user.cpp", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 274 | "libavb_user/avb_user_verity.c", |
David Zeuthen | 0922bf8 | 2017-06-19 17:50:38 -0400 | [diff] [blame] | 275 | "libavb_user/avb_user_verification.c", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 276 | ], |
| 277 | } |
| 278 | |
| 279 | cc_binary { |
| 280 | name: "avbctl", |
| 281 | defaults: ["avb_defaults"], |
| 282 | static_libs: [ |
| 283 | "libavb_user", |
| 284 | "libfs_mgr", |
| 285 | ], |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 286 | shared_libs: [ |
| 287 | "libbase", |
| 288 | "libcrypto", |
| 289 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 290 | srcs: ["tools/avbctl/avbctl.cc"], |
| 291 | } |
| 292 | |
| 293 | cc_library_host_static { |
| 294 | name: "libavb_ab_host", |
| 295 | defaults: ["avb_defaults"], |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 296 | header_libs: [ |
| 297 | "avb_headers", |
| 298 | ], |
| 299 | export_header_lib_headers: ["avb_headers"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 300 | cflags: [ |
| 301 | "-fno-stack-protector", |
David Zeuthen | 37f5946 | 2017-09-20 15:02:32 -0400 | [diff] [blame] | 302 | "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 303 | ], |
| 304 | srcs: ["libavb_ab/avb_ab_flow.c"], |
| 305 | } |
| 306 | |
Tianjie | 7f4e000 | 2020-04-12 21:45:09 -0700 | [diff] [blame] | 307 | cc_library_static { |
| 308 | name: "libavb_aftl", |
Dan Austin | 6bda987 | 2020-01-22 19:14:15 -0800 | [diff] [blame] | 309 | defaults: [ |
| 310 | "avb_defaults", |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 311 | "avb_sources", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 312 | "avb_crypto_ops_impl_boringssl", |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 313 | ], |
Tianjie | 7f4e000 | 2020-04-12 21:45:09 -0700 | [diff] [blame] | 314 | host_supported: true, |
| 315 | recovery_available: true, |
Dan Austin | 6bda987 | 2020-01-22 19:14:15 -0800 | [diff] [blame] | 316 | header_libs: ["avb_headers"], |
| 317 | export_header_lib_headers: ["avb_headers"], |
| 318 | cflags: [ |
| 319 | "-fno-stack-protector", |
| 320 | ], |
| 321 | srcs: [ |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 322 | "libavb_aftl/avb_aftl_util.c", |
| 323 | "libavb_aftl/avb_aftl_validate.c", |
| 324 | "libavb_aftl/avb_aftl_verify.c", |
Dan Austin | 6bda987 | 2020-01-22 19:14:15 -0800 | [diff] [blame] | 325 | ], |
| 326 | } |
| 327 | |
ThiƩbaud Weksteen | c5c42b5 | 2020-05-15 14:07:02 +0200 | [diff] [blame] | 328 | cc_fuzz { |
| 329 | name: "libavb_aftl_fuzzer", |
| 330 | defaults: ["avb_defaults"], |
| 331 | // The fuzzing entry point is declared and defined in the same file. |
| 332 | // Overwrite the behaviour introduced by avb_defaults. |
| 333 | cflags: [ |
| 334 | "-Wno-missing-prototypes", |
| 335 | ], |
| 336 | srcs: [ |
| 337 | "test/avb_aftl_fuzz.cc", |
| 338 | ], |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 339 | static_libs: [ |
| 340 | "libavb", |
| 341 | "libavb_aftl", |
| 342 | ], |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 343 | shared_libs: ["libcrypto"], |
ThiƩbaud Weksteen | c5c42b5 | 2020-05-15 14:07:02 +0200 | [diff] [blame] | 344 | host_supported: true, |
| 345 | corpus: ["test/corpus/*"], |
| 346 | fuzz_config: { |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 347 | cc: [ |
| 348 | "tweek@google.com", |
| 349 | "jpm@google.com", |
| 350 | ], |
ThiƩbaud Weksteen | c5c42b5 | 2020-05-15 14:07:02 +0200 | [diff] [blame] | 351 | componentid: 685985, |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 352 | }, |
ThiƩbaud Weksteen | c5c42b5 | 2020-05-15 14:07:02 +0200 | [diff] [blame] | 353 | } |
| 354 | |
Dan Austin | 6bda987 | 2020-01-22 19:14:15 -0800 | [diff] [blame] | 355 | cc_library_host_static { |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 356 | name: "libavb_atx_host", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 357 | defaults: [ |
| 358 | "avb_defaults", |
| 359 | "avb_crypto_ops_impl_boringssl", |
| 360 | ], |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 361 | header_libs: [ |
| 362 | "avb_headers", |
| 363 | ], |
| 364 | export_header_lib_headers: ["avb_headers"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 365 | cflags: [ |
| 366 | "-fno-stack-protector", |
| 367 | ], |
| 368 | srcs: ["libavb_atx/avb_atx_validate.c"], |
| 369 | } |
| 370 | |
| 371 | cc_library_host_static { |
| 372 | name: "libavb_host_sysdeps", |
| 373 | defaults: ["avb_defaults"], |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 374 | header_libs: [ |
| 375 | "avb_headers", |
| 376 | ], |
| 377 | export_header_lib_headers: ["avb_headers"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 378 | srcs: ["libavb/avb_sysdeps_posix.c"], |
| 379 | } |
| 380 | |
Darren Krahn | 8160f36 | 2017-10-05 22:11:02 -0700 | [diff] [blame] | 381 | cc_library_host_static { |
| 382 | name: "libavb_things_example", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 383 | defaults: [ |
| 384 | "avb_defaults", |
| 385 | "avb_crypto_ops_impl_boringssl", |
| 386 | ], |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 387 | header_libs: [ |
| 388 | "avb_headers", |
| 389 | ], |
| 390 | export_header_lib_headers: ["avb_headers"], |
Darren Krahn | 8160f36 | 2017-10-05 22:11:02 -0700 | [diff] [blame] | 391 | srcs: ["examples/things/avb_atx_slot_verify.c"], |
| 392 | } |
| 393 | |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 394 | cc_defaults { |
| 395 | name: "libavb_host_unittest_core", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 396 | defaults: ["avb_defaults"], |
| 397 | required: [ |
| 398 | "simg2img", |
| 399 | "img2simg", |
| 400 | "avbtool", |
| 401 | ], |
Julien Desprez | 15e81d9 | 2021-01-21 11:29:14 -0800 | [diff] [blame] | 402 | test_options: { |
| 403 | unit_test: true, |
| 404 | }, |
| 405 | compile_multilib: "first", |
Bryan Henry | b24af10 | 2018-10-25 18:20:23 -0700 | [diff] [blame] | 406 | data: [ |
| 407 | "avbtool", |
Jan Monsch | cd7c913 | 2020-05-08 02:34:40 +0200 | [diff] [blame] | 408 | "test/avbtool_signing_helper_test.py", |
| 409 | "test/avbtool_signing_helper_with_files_test.py", |
Bryan Henry | b24af10 | 2018-10-25 18:20:23 -0700 | [diff] [blame] | 410 | "test/data/*", |
| 411 | ], |
| 412 | test_config: "test/libavb_host_unittest.xml", |
Bryan Henry | d7156cd | 2019-01-24 16:32:52 -0800 | [diff] [blame] | 413 | test_suites: ["general-tests"], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 414 | static_libs: [ |
| 415 | "libavb", |
| 416 | "libavb_ab_host", |
Tianjie | 7f4e000 | 2020-04-12 21:45:09 -0700 | [diff] [blame] | 417 | "libavb_aftl", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 418 | "libavb_atx_host", |
Darren Krahn | 8160f36 | 2017-10-05 22:11:02 -0700 | [diff] [blame] | 419 | "libavb_things_example", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 420 | "libgmock_host", |
| 421 | "libgtest_host", |
| 422 | ], |
| 423 | shared_libs: [ |
Bryan Henry | 573bb4c | 2018-12-01 11:42:18 -0800 | [diff] [blame] | 424 | "libbase", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 425 | "libchrome", |
| 426 | "libcrypto", |
| 427 | ], |
David Zeuthen | 047ecf7 | 2017-06-28 14:10:55 -0400 | [diff] [blame] | 428 | cflags: [ |
ThiƩbaud Weksteen | 23dbe6e | 2020-05-15 15:52:02 +0200 | [diff] [blame] | 429 | "-Wno-missing-prototypes", |
| 430 | "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", |
David Zeuthen | 047ecf7 | 2017-06-28 14:10:55 -0400 | [diff] [blame] | 431 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 432 | srcs: [ |
| 433 | "test/avb_ab_flow_unittest.cc", |
Jan Monsch | a86b614 | 2020-02-17 12:44:41 +0100 | [diff] [blame] | 434 | "test/avb_aftl_util_unittest.cc", |
Dan Austin | 6bda987 | 2020-01-22 19:14:15 -0800 | [diff] [blame] | 435 | "test/avb_aftl_validate_unittest.cc", |
Dan Austin | a4fc595 | 2020-02-14 11:32:17 -0800 | [diff] [blame] | 436 | "test/avb_aftl_verify_unittest.cc", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 437 | "test/avb_atx_validate_unittest.cc", |
Darren Krahn | 8160f36 | 2017-10-05 22:11:02 -0700 | [diff] [blame] | 438 | "test/avb_atx_slot_verify_unittest.cc", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 439 | "test/avb_crypto_ops_unittest.cc", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 440 | "test/avb_slot_verify_unittest.cc", |
| 441 | "test/avb_unittest_util.cc", |
| 442 | "test/avb_util_unittest.cc", |
| 443 | "test/avb_vbmeta_image_unittest.cc", |
| 444 | "test/avbtool_unittest.cc", |
| 445 | "test/fake_avb_ops.cc", |
| 446 | "test/avb_sysdeps_posix_testing.cc", |
| 447 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 448 | } |
| 449 | |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 450 | cc_test_host { |
| 451 | name: "libavb_host_unittest", |
| 452 | defaults: [ |
| 453 | "avb_crypto_ops_impl_boringssl", |
| 454 | "libavb_host_unittest_core", |
| 455 | ], |
| 456 | data: [ |
| 457 | ":img2simg", |
| 458 | ":simg2img", |
| 459 | ":fec", |
| 460 | ], |
| 461 | } |
| 462 | |
| 463 | cc_test_host { |
| 464 | name: "libavb_host_unittest_sha", |
| 465 | defaults: [ |
| 466 | "avb_crypto_ops_impl_sha", |
| 467 | "libavb_host_unittest_core", |
| 468 | ], |
| 469 | data: [ |
| 470 | ":img2simg", |
| 471 | ":simg2img", |
| 472 | ":fec", |
| 473 | ], |
| 474 | } |
| 475 | |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 476 | cc_library_host_static { |
| 477 | name: "libavb_host_user_code_test", |
| 478 | defaults: ["avb_defaults"], |
David Zeuthen | 37f5946 | 2017-09-20 15:02:32 -0400 | [diff] [blame] | 479 | cflags: [ |
| 480 | "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", |
| 481 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 482 | srcs: ["test/user_code_test.cc"], |
| 483 | } |
| 484 | |
| 485 | cc_library { |
| 486 | name: "bootctrl.avb", |
| 487 | defaults: ["avb_defaults"], |
| 488 | relative_install_path: "hw", |
| 489 | static_libs: [ |
| 490 | "libavb_user", |
| 491 | "libfs_mgr", |
| 492 | ], |
| 493 | shared_libs: [ |
| 494 | "libbase", |
Andrew Scull | 725bff4 | 2021-04-29 20:39:42 +0000 | [diff] [blame] | 495 | "libcrypto", |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 496 | "libcutils", |
| 497 | ], |
David Zeuthen | 37f5946 | 2017-09-20 15:02:32 -0400 | [diff] [blame] | 498 | cflags: [ |
| 499 | "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", |
| 500 | ], |
Tom Cherry | 8d225d8 | 2017-05-12 17:00:31 -0700 | [diff] [blame] | 501 | srcs: ["boot_control/boot_control_avb.c"], |
| 502 | } |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 503 | |
| 504 | cc_library_headers { |
| 505 | name: "avb_headers", |
| 506 | host_supported: true, |
Inseob Kim | f1bca77 | 2021-06-14 11:53:04 +0900 | [diff] [blame^] | 507 | ramdisk_available: true, |
Chin-Ting Kuo | 3cf5c72 | 2019-09-16 11:38:01 +0800 | [diff] [blame] | 508 | recovery_available: true, |
| 509 | export_include_dirs: ["."], |
| 510 | target: { |
| 511 | windows: { |
| 512 | enabled: true, |
| 513 | }, |
| 514 | }, |
| 515 | } |