blob: ce9a3751042cfd097f1ba5d2b4976ef2774da024 [file] [log] [blame]
# Copyright 2018 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/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/vbmeta.gni")
import("//build/images/vboot/vboot.gni")
import("//build/images/zedboot/zedboot_args.gni")
import("//build/product.gni")
assert(current_toolchain == default_toolchain,
"//build/images/* are only valid in the Fuchsia toolchain")
_product_config = "//products/zedboot"
if (zedboot_product_assembly_config_label != false) {
_product_config = zedboot_product_assembly_config_label
}
# Note: This ZBI output is also used by a script in //scripts/verify_cmdline_params.
assembled_system("zedboot_assembly") {
testonly = true
output_dir = root_build_dir
image_name = "zedboot"
include_shell_commands = false
generate_vbmeta = use_vbmeta
use_bringup_platform_bundles_only = true
product_assembly_config_label = _product_config
board_config_label = board_configuration_label
# Bazel assembly should not depend on any targets from GN assembly other
# than the legacy AIB.
legacy_bundle_only = use_bazel_images_only
base_packages = []
additional_boot_args = [
"netsvc.all-features=true",
"netsvc.netboot=true",
] + zedboot_additional_boot_args
cmdline = [
"virtcon.colorscheme=special",
"virtcon.dpi=160,240,360,480",
]
bootfs_labels = [ "//build/input:zedboot_bootfs" ]
# Needed for installer runs.
bootfs_labels += [
"//src/storage/bin/disk-pave:install-disk-image",
"//src/storage/bin/mount",
]
# For debugging.
bootfs_labels += [
"//src/devices/nand/drivers/broker:nand-broker",
"//src/storage/bin/umount",
"//src/storage/tools/logs/run-with-logs",
]
# zbi arguments
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
}
image_metadata_overrides = legacy_zedboot_image_metadata_overrides
metadata = {
update_target = []
if (!sign_zbi) {
update_target += [ "zedboot=zedboot.zbi" ]
}
# Optionally include the signed images.
if (sign_zbi) {
update_target += [ "zedboot.signed=zedboot.zbi.signed" ]
if (recovery_is_zedboot) {
mkzedboot_mode = [ "vboot" ]
}
}
# Optionally include the vbmeta.
if (use_vbmeta) {
if (recovery_is_zedboot) {
# Only include zedboot as recovery.vbmeta if zedboot is used as recovery
update_target += [ "recovery.vbmeta=zedboot.vbmeta" ]
}
}
}
}
if (target_cpu != "arm64" && !use_vboot && !use_bazel_images_only) {
esp("esp") {
output_name = "zedboot"
cmdline = "efi_cmdline.txt"
deps = [ ":zedboot_assembly" ]
zedboot = "$root_build_dir/zedboot.zbi"
testonly = true
metadata = {
images = [
{
label = get_label_info(":$target_name", "label_with_toolchain")
mkzedboot_mode = [ "efi" ]
name = "zedboot-efi"
path = "zedboot.esp.blk"
type = "blk"
},
]
}
}
}
group("zedboot") {
if (!use_bazel_images_only) {
public_deps = [ ":zedboot_assembly" ]
if (target_cpu != "arm64" && !use_vboot) {
public_deps += [ ":esp" ]
}
}
testonly = true
}