| # Copyright 2020 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/assembly/assembled_system.gni") |
| import("//build/assembly/generated_partitions_config.gni") |
| import("//build/assembly/legacy_image_metadata_overrides.gni") |
| import("//build/assembly/product_assembly_configuration.gni") |
| import("//build/board.gni") |
| import("//build/images/args.gni") |
| import("//build/images/custom_signing.gni") |
| import("//build/images/vboot/vboot.gni") |
| import("//build/sdk/product_bundle.gni") |
| import("//build/security.gni") |
| import("//zircon/kernel/phys/qemu.gni") |
| |
| assert(current_toolchain == default_toolchain, |
| "//build/images/* are only valid in the Fuchsia toolchain") |
| |
| files = { |
| partitions_config = "$target_out_dir/partitions_config.json" |
| |
| # Outputs of assembly. |
| outdir = target_out_dir + "/bringup" |
| zbi = "${outdir}/bringup.zbi" |
| zbi_signed = "${outdir}/bringup.zbi.signed" |
| vbmeta = "${outdir}/bringup.vbmeta" |
| images_json = "${outdir}/images.json" |
| |
| # Outputs of recovery. |
| recovery_name = get_label_info(recovery_label, "name") |
| recovery_outdir = |
| get_label_info(recovery_label, "target_out_dir") + "/" + recovery_name |
| recovery_zbi = "${recovery_outdir}/${recovery_name}.zbi" |
| recovery_zbi_signed = "${recovery_outdir}/${recovery_name}.zbi.signed" |
| recovery_vbmeta = "${recovery_outdir}/${recovery_name}.vbmeta" |
| recovery_images_json = "${recovery_outdir}/images.json" |
| |
| qemu_kernel = qemu_boot_shim.path |
| } |
| |
| _partitions_config = "//boards/partitions:default" |
| if (has_board) { |
| assert(partitions_config_label != false, |
| "Need to define partitions_config_label") |
| _partitions_config = partitions_config_label |
| } |
| _partitions_config_file = |
| get_label_info(_partitions_config, "target_out_dir") + "/" + |
| get_label_info(_partitions_config, "name") + "/partitions_config.json" |
| |
| product_assembly_configuration("product_assembly_config") { |
| platform = { |
| feature_set_level = "bootstrap" |
| build_type = "eng" |
| kernel = { |
| oom_behavior = "job_kill" |
| } |
| storage = { |
| filesystems = { |
| image_name = "bringup" |
| image_mode = "no_image" |
| volume = { |
| fvm = { |
| blob = { |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| # The bringup product can't specify anything in base/cache packages, as it |
| # doesn't have an fvm with blobfs. |
| product = { |
| } |
| } |
| |
| bringup_base = { |
| testonly = true |
| output_dir = root_build_dir |
| generate_vbmeta = use_vbmeta |
| |
| if (custom_signing_script != "") { |
| inputs = custom_signing_script_inputs |
| generate_signed_zbi = true |
| } else if (use_vboot) { |
| inputs = vboot_action.inputs |
| generate_signed_zbi = true |
| } |
| |
| product_assembly_config_label = ":product_assembly_config" |
| board_config_label = board_configuration_label |
| use_bringup_platform_bundles_only = true |
| |
| include_shell_commands = false |
| |
| cmdline_deps = [ "//build/input:bootfs" ] |
| |
| base_packages = [] |
| |
| bootfs_labels = [ |
| "//build/input:bootfs", |
| "//:developer_base_packages", |
| ] |
| } |
| |
| assembled_system("bringup_assembly") { |
| forward_variables_from(bringup_base, "*") |
| image_name = "bringup" |
| image_metadata_overrides = legacy_bringup_image_metadata_overrides |
| } |
| |
| product_bundle("product_bundle") { |
| testonly = true |
| deps = [ |
| ":bringup_assembly", |
| _partitions_config, |
| recovery_label, |
| ] |
| |
| name = main_product_bundle_name |
| partitions = _partitions_config_file |
| system_a = files.images_json |
| system_r = files.recovery_images_json |
| |
| # Create lists of the files that are referenced by the assembly manifests. |
| _assembly_contents = [ files.qemu_kernel ] |
| _recovery_contents = [ files.qemu_kernel ] |
| |
| _assembly_contents += [ files.zbi ] |
| _recovery_contents += [ files.recovery_zbi ] |
| |
| if (use_vbmeta) { |
| _assembly_contents += [ files.vbmeta ] |
| _recovery_contents += [ files.recovery_vbmeta ] |
| } |
| |
| # List the contents of each input so that the outputs can be calculated. |
| system_a_contents = _assembly_contents |
| system_r_contents = _recovery_contents |
| } |
| |
| group("bringup") { |
| testonly = true |
| public_deps = [ ":product_bundle" ] |
| } |