| # 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") |
| import("//build/zbi/zbi_input.gni") |
| |
| group("bootsvc") { |
| deps = [ |
| ":bin-input", |
| ":cmdline", |
| ] |
| } |
| |
| # There are also integration tests under intergration_test/, but they are not component tests so |
| # they aren't included in the same way. |
| group("tests") { |
| testonly = true |
| deps = [ ":bootsvc-tests" ] |
| } |
| |
| zbi_input("bin-input") { |
| # Using a prefix to install bootsvc in the same spot on zbi's |
| # as back when it was built by the ZN build. |
| # Note that this may be removed post-unification. |
| prefix = "pkg/bootsvc" |
| deps = [ ":bin" ] |
| } |
| |
| zbi_input("cmdline") { |
| visibility = [ ":*" ] |
| type = "cmdline" |
| args = [ "--entry=userboot.root=pkg/bootsvc" ] |
| } |
| |
| source_set("lib") { |
| visibility = [ ":*" ] |
| sources = [ |
| "bootfs-loader-service.cc", |
| "bootfs-loader-service.h", |
| "bootfs-service.cc", |
| "bootfs-service.h", |
| "svcfs-service.cc", |
| "svcfs-service.h", |
| ] |
| public_deps = [ |
| ":util", |
| "//src/lib/loader_service", |
| "//src/lib/storage/vfs/cpp", |
| "//src/storage/memfs:memfs-cpp", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/bootfs", |
| "//src/lib/files", |
| "//src/storage/memfs", |
| "//zircon/public/lib/fidl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async", |
| "//zircon/system/ulib/launchpad", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace-engine", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("bin") { |
| output_name = "bootsvc" |
| sources = [ "main.cc" ] |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/launchpad", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| source_set("util") { |
| visibility = [ "./*" ] |
| sources = [ |
| "util.cc", |
| "util.h", |
| ] |
| deps = [ "//zircon/public/lib/safemath" ] |
| public_deps = [ |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # 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("util_test") { |
| output_name = "bootsvc_util_test" |
| sources = [ "util-test.cc" ] |
| deps = [ |
| ":util", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_component("util-test") { |
| deps = [ ":util_test" ] |
| } |
| |
| test("bootfs_loader_service_test") { |
| sources = [ "bootfs-loader-service-test.cc" ] |
| deps = [ |
| ":lib", |
| "//src/lib/loader_service:loader_service_test_fixture", |
| ] |
| |
| # 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" ] |
| } |
| |
| fuchsia_unittest_component("bootfs-loader-service-test") { |
| manifest = "meta/bootfs-loader-service-test.cmx" |
| deps = [ ":bootfs_loader_service_test" ] |
| } |
| |
| fuchsia_test_package("bootsvc-tests") { |
| test_components = [ |
| ":bootfs-loader-service-test", |
| ":util-test", |
| ] |
| } |