blob: 7c98c708cc60364d02d02bd14a4f98850c83b535 [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/components.gni")
import("//build/test.gni")
fuchsia_component_manifest("manifest") {
component_name = "driver_manager"
manifest = "meta/driver_manager.cml"
restricted_features = [ "allow_long_names" ]
}
fuchsia_structured_config_cpp_elf_lib("driver_manager_config") {
cm_label = ":manifest"
}
fuchsia_structured_config_values("driver_manager_config_default") {
cm_label = ":manifest"
values = {
set_root_driver_host_critical = true
delay_fallback_until_base_drivers_indexed = true
suspend_timeout_fallback = true
verbose = false
driver_host_crash_policy = "restart-driver-host"
root_driver = "fuchsia-boot:///platform-bus#meta/platform-bus.cm"
enable_test_shutdown_delays = false
}
}
# TODO(https://fxbug.dev/42113849): Migrate to the new bind rules and delete the below
source_set("binding") {
sources = [
"binding.cc",
"binding.h",
]
public_deps = [
"//src/lib/ddk",
"//src/lib/ddk:ddk-deprecated-binding-headers",
"//zircon/system/ulib/fbl",
]
deps = [
"//src/devices/lib/bind:bind-lib",
"//src/devices/lib/log",
]
}
source_set("inspect") {
visibility = [ "*" ]
sources = [
"inspect.cc",
"inspect.h",
]
public_deps = [
"//sdk/lib/inspect/component/cpp",
"//src/lib/ddk",
"//src/lib/ddk:ddk-deprecated-binding-headers",
"//src/storage/lib/vfs/cpp",
"//zircon/system/ulib/fbl",
]
deps = [ "//sdk/lib/inspect/component/cpp" ]
}
source_set("driver_host_loader_service") {
visibility = [
":*",
"tests/:*",
]
sources = [
"driver_host_loader_service.cc",
"driver_host_loader_service.h",
]
public_deps = [ "//src/lib/loader_service" ]
deps = [
"//src/devices/lib/log",
"//src/lib/files",
]
}
source_set("driver_runner") {
sources = [
"bind_manager.cc",
"bind_manager.h",
"bind_result_tracker.cc",
"bind_result_tracker.h",
"composite_node_spec_v2.cc",
"composite_node_spec_v2.h",
"driver_host.cc",
"driver_host.h",
"driver_runner.cc",
"driver_runner.h",
"node.cc",
"node.h",
"node_removal_tracker.cc",
"node_removal_tracker.h",
"parent_set_collector.cc",
"parent_set_collector.h",
"runner.cc",
"runner.h",
"shutdown_helper.cc",
"shutdown_helper.h",
"shutdown_manager.cc",
"shutdown_manager.h",
]
deps = [
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/component/outgoing/cpp",
"//sdk/lib/driver/component/cpp:cpp",
"//sdk/lib/zbi-format",
"//src/bringup/lib/mexec",
"//src/devices/bin/driver_manager:binding",
"//src/devices/bin/driver_manager/composite_node_spec:lib",
"//src/devices/bind/fuchsia.platform:fuchsia.platform_cpp",
"//src/devices/lib/log",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/lib/zbitl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
]
public_deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_cpp",
"//sdk/fidl/fuchsia.component:fuchsia.component_cpp",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp",
"//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_cpp",
"//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_cpp",
"//sdk/fidl/fuchsia.driver.development:fuchsia.driver.development_cpp",
"//sdk/fidl/fuchsia.driver.host:fuchsia.driver.host_cpp",
"//sdk/fidl/fuchsia.driver.index:fuchsia.driver.index_cpp",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_cpp",
"//sdk/lib/async_patterns/cpp",
"//sdk/lib/inspect/component/cpp",
"//sdk/lib/vfs/cpp",
"//src/devices/bin/driver_manager:inspect",
"//src/devices/bin/driver_manager/devfs",
"//src/lib/ddk",
"//src/storage/lib/vfs/cpp",
"//zircon/system/ulib/zircon-internal",
]
}
source_set("driver_development_service") {
sources = [
"driver_development_service.cc",
"driver_development_service.h",
]
public_deps = [
":driver_runner",
"//sdk/fidl/fuchsia.driver.development:fuchsia.driver.development_cpp",
"//sdk/lib/component/outgoing/cpp",
]
deps = [
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/lib/component/incoming/cpp",
"//src/devices/bin/driver_manager/driver_development:lib",
"//src/devices/lib/log",
]
}
executable("driver_manager") {
sources = [ "main.cc" ]
deps = [
":driver_development_service",
":driver_host_loader_service",
":driver_manager_config",
":driver_runner",
"//src/devices/lib/log",
"//src/sys/lib/stdout-to-debuglog/cpp",
]
configs += [ "//build/config:all_source" ]
if (toolchain_variant.libprefix != "") {
# The libprefix always ends with a / but that's not part of the
# "config" string in the loader-service protocol.
ldsvc_config =
get_path_info("${toolchain_variant.libprefix}libfoo.so", "dir")
assert(ldsvc_config != "" && ldsvc_config != ".")
defines = [ "DRIVERHOST_LDSVC_CONFIG=\"$ldsvc_config\"" ]
}
}
fuchsia_component("component") {
cm_label = ":manifest"
deps = [ ":driver_manager" ]
}
# List of shared libraries used by drivers.
group("driver_shared_libraries") {
deps = [
"//sdk/lib/fdio",
"//sdk/lib/svc",
"//sdk/lib/syslog/cpp:backend_fuchsia_globals",
"//src/devices/bin/driver_runtime",
"//src/devices/lib/driver",
"//src/security/lib/tee/tee-client-api",
"//third_party/boringssl:crypto-shared",
"//third_party/boringssl:ssl-shared",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/syslog",
"//zircon/system/ulib/trace-engine",
]
}
fuchsia_package("package") {
package_name = "driver_manager"
deps = [
":component",
":driver_manager_config_default",
":driver_shared_libraries",
]
}