| # Copyright 2021 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| |
| group("android") { |
| deps = [ ":test_android_distro" ] |
| } |
| |
| template("tar_resource") { |
| main_target = target_name |
| untar_target = "${target_name}__untar" |
| manifest_file = "$target_gen_dir/$target_name.manifest.json" |
| action(untar_target) { |
| script = "tar_to_fini.py" |
| inputs = [ invoker.tarfile ] |
| outputs = [ manifest_file ] |
| depfile = "$target_gen_dir/$target_name.d" |
| args = [ |
| "--tar-file", |
| rebase_path(inputs[0], root_build_dir), |
| "--unpack-dir", |
| rebase_path("$target_gen_dir/$target_name", root_build_dir), |
| "--manifest-file", |
| rebase_path(manifest_file, root_build_dir), |
| "--dep-file", |
| rebase_path(depfile, root_build_dir), |
| ] |
| if (defined(invoker.subdir)) { |
| args += [ |
| "--package-subdir", |
| invoker.subdir, |
| ] |
| } |
| } |
| distribution_entries_from_fini(main_target) { |
| file = manifest_file |
| deps = [ ":$untar_target" ] |
| } |
| } |
| |
| tar_resource("android_system_image") { |
| tarfile = "//prebuilt/starnix/android-root-amd64/system.img.tar" |
| subdir = "root" |
| } |
| |
| fuchsia_component("init") { |
| manifest = "meta/init.cml" |
| } |
| |
| fuchsia_component("sh") { |
| manifest = "meta/sh.cml" |
| } |
| |
| fuchsia_package("test_android_distro") { |
| deps = [ |
| ":android_system_image", |
| ":init", |
| ":sh", |
| ] |
| |
| # This package intentionally contains many non-Fuchia ELF binaries that |
| # are not under /data/, and some of them are even unstripped, so disable |
| # theses checks to build successfully. |
| disable_elf_binaries_checks = true |
| } |