blob: 235a4b2f62ef4127166521c0baba068599fdca28 [file] [log] [blame]
# Copyright 2019 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/bootfs_files_for_assembly.gni")
import("//build/components.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/rust/rustc_binary.gni")
import("//src/storage/fshost/fshost.gni")
# This is only used for generating the structured configuration library, as the
# main cml is produced by assembly.
fshost_cml("fshost_for_config_lib.cml") {
options = {
bootfs_only = true
}
}
fuchsia_component_manifest("fshost_manifest_for_config_lib") {
component_name = "fshost"
manifest = get_target_outputs(":fshost_for_config_lib.cml")
manifest = manifest[0]
deps = [ ":fshost_for_config_lib.cml" ]
}
fuchsia_structured_config_rust_lib("fshost_config_rust") {
name = "fshost_config"
cm_label = ":fshost_manifest_for_config_lib"
}
rustc_binary("fshost") {
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_rust",
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.device:fuchsia.device_rust",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.fs:fuchsia.fs_rust",
"//sdk/fidl/fuchsia.fshost:fuchsia.fshost_rust",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted_rust",
"//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//sdk/lib/device-watcher/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/security/lib/kms-stateless/rust",
"//src/storage/fshost:fshost_config_rust",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/lib/fs_management/rust:fs_management",
"//src/storage/lib/key-bag",
"//src/storage/lib/ramdevice_client/rust",
"//src/storage/lib/vfs/rust:vfs",
"//src/sys/pkg/fidl/fuchsia.update.verify:fuchsia.update.verify_rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:scopeguard",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:uuid",
"//third_party/rust_crates:zerocopy",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
non_rust_deps = [ "//src/storage/lib/fs_management/c" ]
test_deps = [
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
]
sources = [
"src/boot_args.rs",
"src/config.rs",
"src/copier.rs",
"src/crypt.rs",
"src/crypt/fxfs.rs",
"src/crypt/zxcrypt.rs",
"src/device.rs",
"src/device/constants.rs",
"src/environment.rs",
"src/fxblob.rs",
"src/inspect.rs",
"src/main.rs",
"src/manager.rs",
"src/matcher.rs",
"src/ramdisk.rs",
"src/service.rs",
"src/volume.rs",
"src/watcher.rs",
]
with_unit_tests = true
configs += [ "//build/config/rust:bootfs" ]
}
fuchsia_unittest_component("fshost_tests_component") {
component_name = "fshost_tests"
deps = [ ":fshost_test" ]
}
fuchsia_test_package("fshost_tests") {
test_components = [ ":fshost_tests_component" ]
}
bootfs_files_for_assembly("assembly_bundle_fshost_common") {
deps = [ ":fshost" ]
}
bootfs_files_for_assembly("assembly_bundle_fshost_storage_common") {
deps = [ "//src/storage/memfs:memfs_component" ]
}
blobfs_deps = [
"//src/storage/blobfs:decompressor-sandbox",
"//src/storage/blobfs/bin:blobfs-component",
]
# The default configuration (Fxblob).
bootfs_files_for_assembly("assembly_bundle_fshost") {
deps = [
"//src/storage/fxfs:fxfs_component",
"//src/storage/fxfs-crypt",
]
}
# Blobfs-only.
bootfs_files_for_assembly("assembly_bundle_fshost_fvm") {
deps = blobfs_deps
}
# FVM+Fxfs (non-Fxblob)
bootfs_files_for_assembly("assembly_bundle_fshost_fvm_fxfs") {
deps = blobfs_deps + [
"//src/storage/fxfs:fxfs_component",
"//src/storage/fxfs-crypt",
]
}
bootfs_files_for_assembly("assembly_bundle_fshost_minfs") {
deps = blobfs_deps + [ "//src/storage/minfs/bin:minfs-component" ]
}
bootfs_files_for_assembly("assembly_bundle_fshost_f2fs") {
deps = blobfs_deps + [ "//src/storage/f2fs/bin:f2fs-component" ]
}
source_set("admin-client") {
sources = [
"admin-client.cc",
"admin-client.h",
]
public_deps = [
"//sdk/fidl/fuchsia.fshost:fuchsia.fshost_cpp",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_cpp",
"//sdk/lib/component/incoming/cpp",
"//zircon/system/ulib/zx",
]
}
group("tests") {
testonly = true
public_deps = [
":fshost_tests",
"integration:tests",
]
}