blob: 56b1b09ab4ad9492c4f4eff5068e63650a111a2d [file] [log] [blame]
# 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/components.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/zbi/kernel_cmdline.gni")
group("bootfs") {
deps = [
":device-name-provider",
":meta",
]
}
group("tests") {
testonly = true
deps = [ "tests" ]
}
component_manifest_resources("meta") {
sources = [ "meta/device-name-provider.cml" ]
}
source_set("args") {
sources = [ "args.cc" ]
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp",
"//sdk/lib/fdio",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
executable("device-name-provider") {
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [ "device-name-provider.cc" ]
deps = [
":args",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//src/lib/storage/vfs/cpp",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
"//zircon/system/ulib/inet6:netifc-discover",
"//zircon/system/ulib/svc",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
# This component only exists to be included in the integration tests.
fuchsia_component("device-name-provider-component") {
testonly = true
manifest = "meta/device-name-provider.cml"
deps = [ ":device-name-provider" ]
}
# command line package to be included for new-style nodename generation.
kernel_cmdline("nodenames-newgen") {
args = [ "zircon.namegen=1" ]
}
# command line package to be included for old-style nodename generation.
kernel_cmdline("nodenames-oldgen") {
args = [ "zircon.namegen=0" ]
}