| # 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") |
| |
| 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) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "debug-command.cc", |
| "netsvc.cc", |
| ] |
| deps = [ |
| ":args", |
| ":inet6", |
| ":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/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/service:service-llcpp", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/tftp", |
| "//zircon/system/ulib/zx", |
| ] |
| data_deps = [ |
| # netsvc launches /boot/bin/sh for netruncmd. |
| "//zircon/third_party/uapp/dash", |
| ] |
| configs += [ ":netsvc_config" ] |
| } |
| |
| source_set("args") { |
| sources = [ "args.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//zircon/system/ulib/service:service-llcpp", |
| ] |
| } |
| |
| source_set("netsvc_common") { |
| sources = [ |
| "board-info.cc", |
| "debuglog.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/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 = [ |
| ":inet6", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_llcpp", |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver_llcpp", |
| "//src/storage/testing:fake-paver", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/tftp", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| test("netsvc-test") { |
| sources = [ |
| "test/args-test.cc", |
| "test/debuglog-test.cc", |
| "test/file-api-test.cc", |
| "test/paver-test.cc", |
| "test/payload-streamer-test.cc", |
| ] |
| deps = [ |
| ":args", |
| ":netsvc", |
| ":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/devices/testing/devmgr-integration-test-shim", |
| "//src/lib/storage/ramdevice_client/cpp", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/mock-boot-arguments", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| 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/devices/testing/devmgr-integration-test-shim", |
| "//src/lib/storage/ramdevice_client/cpp", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_test_component("netsvc-stress-test-component") { |
| component_name = "netsvc-stress-test" |
| manifest = "meta/netsvc-stress-test.cml" |
| deps = [ |
| ":netsvc-stress-test", |
| "//src/devices/board/drivers/integration-test", |
| "//src/devices/bus/drivers/platform", |
| ] |
| } |
| |
| fuchsia_test_component("netsvc-test-component") { |
| component_name = "netsvc-test" |
| manifest = "meta/netsvc-test.cml" |
| deps = [ |
| ":netsvc-test", |
| "//src/bringup/bin/device-name-provider:device-name-provider-component", |
| "//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", |
| ] |
| } |
| |
| # This component only exists to be included in the integration tests. |
| fuchsia_component("test-component") { |
| testonly = true |
| component_name = "netsvc" |
| manifest = "meta/netsvc.cml" |
| deps = [ ":netsvc" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":netsvc-tests-package", |
| "test/integration", |
| ] |
| } |
| |
| fuchsia_test_package("netsvc-tests-package") { |
| package_name = "netsvc-tests" |
| test_components = [ |
| ":netsvc-stress-test-component", |
| ":netsvc-test-component", |
| ] |
| } |
| |
| # NB: These sources were historically part of a zircon library called inet6. |
| source_set("inet6") { |
| sources = [ |
| "checksum.cc", |
| "eth-client.cc", |
| "inet6.cc", |
| "inet6.h", |
| "netifc.cc", |
| "netifc.h", |
| ] |
| deps = [ |
| ":netifc-discover", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_llcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fit", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxc", |
| ] |
| public_deps = [ "//src/connectivity/lib/network-device/cpp" ] |
| visibility = [ ":*" ] |
| } |
| |
| source_set("netifc-discover") { |
| sources = [ |
| "inet6.h", |
| "netifc-discover.cc", |
| "netifc-discover.h", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/fsl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/service:service-llcpp", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_llcpp", |
| "//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_llcpp", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/bringup/bin/device-name-provider:*", |
| ] |
| } |