| # 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/dist/component_manifest_resources.gni") |
| import("//build/test.gni") |
| import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni") |
| |
| group("bootfs") { |
| deps = [ |
| ":meta", |
| ":netsvc", |
| ] |
| } |
| |
| component_manifest_resources("meta") { |
| sources = [ "meta/netsvc.cml" ] |
| } |
| |
| declare_args() { |
| netsvc_extra_defines = [] |
| } |
| |
| config("netsvc_config") { |
| defines = netsvc_extra_defines |
| } |
| |
| executable("netsvc") { |
| 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 = [ |
| "debug-command.cc", |
| "debuglog.cc", |
| "netsvc.cc", |
| ] |
| deps = [ |
| ":args", |
| ":netsvc_common", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_c", |
| "//sdk/lib/fdio", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/tftp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/inet6", |
| ] |
| data_deps = [ |
| # netsvc launches /boot/bin/sh for netruncmd. |
| "//zircon/third_party/uapp/dash", |
| ] |
| configs += [ ":netsvc_config" ] |
| |
| # 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" ] |
| } |
| |
| 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" ] |
| } |
| |
| source_set("netsvc_common") { |
| sources = [ |
| "board-info.cc", |
| "file-api.cc", |
| "netboot.cc", |
| "netcp.cc", |
| "paver.cc", |
| "payload-streamer.cc", |
| "tftp.cc", |
| "zbi.cc", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_llcpp", |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_llcpp", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_llcpp", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_c", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_llcpp", |
| "//sdk/lib/fdio", |
| "//src/bringup/lib/mexec", |
| "//src/lib/bootfs", |
| "//src/storage/gpt", |
| "//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/service:service-llcpp", |
| "//zircon/system/ulib/sysconfig-client:sysconfig-sync-client", |
| "//zircon/system/ulib/zbitl", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver_llcpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/tftp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/inet6", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| |
| # 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" ] |
| } |
| |
| test("netsvc-test") { |
| sources = [ |
| "test/args-test.cc", |
| "test/file-api-test.cc", |
| "test/paver-test.cc", |
| "test/payload-streamer-test.cc", |
| "test/tftp-test.cc", |
| ] |
| deps = [ |
| ":args", |
| ":netsvc_common", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/devmgr-integration-test", |
| "//zircon/system/ulib/driver-integration-test", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/mock-boot-arguments", |
| "//zircon/system/ulib/ramdevice-client", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| |
| # 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" ] |
| } |
| |
| test("netsvc-stress-test") { |
| sources = [ "test/paver-stress-test.cc" ] |
| deps = [ |
| ":netsvc_common", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/devmgr-integration-test", |
| "//zircon/system/ulib/driver-integration-test", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/ramdevice-client", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| |
| # 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" ] |
| } |
| |
| isolated_devmgr_unittest_component("netsvc-stress-test-component") { |
| component_name = "netsvc-stress-test" |
| executable_path = "test/netsvc-stress-test" |
| deps = [ |
| ":netsvc-stress-test", |
| "//src/devices/board/drivers/integration-test", |
| "//src/devices/bus/drivers/platform", |
| ] |
| } |
| |
| isolated_devmgr_unittest_component("netsvc-test-component") { |
| component_name = "netsvc-test" |
| executable_path = "test/netsvc-test" |
| deps = [ |
| ":netsvc", |
| ":netsvc-test", |
| "//src/devices/block/drivers/core", |
| "//src/devices/block/drivers/gpt", |
| "//src/devices/block/drivers/ramdisk", |
| "//src/devices/board/drivers/integration-test", |
| "//src/devices/bus/drivers/platform", |
| ] |
| } |
| |
| fuchsia_test_package("tests") { |
| package_name = "netsvc-tests" |
| test_components = [ |
| ":netsvc-stress-test-component", |
| ":netsvc-test-component", |
| ] |
| } |