| # 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/assembly/bootfs_files_for_assembly.gni") |
| import("//build/components.gni") |
| import("//build/test.gni") |
| |
| declare_args() { |
| # The number of pager threads to spawn for blobfs. |
| blobfs_num_pager_threads = 2 |
| } |
| |
| executable("blobfs") { |
| sources = [ "main.cc" ] |
| deps = [ |
| ":blobfs-component-config", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_wire", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp_wire", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_cpp_wire", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/storage/block_client/cpp", |
| "//src/lib/storage/vfs/cpp", |
| "//src/storage/blobfs", |
| "//src/storage/blobfs:decompressor-sandbox", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_component_manifest("blobfs.cml") { |
| component_name = "blobfs" |
| manifest = "meta/blobfs.cml" |
| } |
| |
| expect_includes("blobfs_fs_management_shard") { |
| includes = [ "//src/lib/storage/fs_management/client.shard.cml" ] |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":blobfs.cml" |
| deps = [ |
| ":blobfs", |
| ":blobfs-component-config-values", |
| ] |
| } |
| |
| group("blobfs-component") { |
| deps = [ |
| ":blobfs_fs_management_shard", |
| ":component", |
| ] |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("blobfs-component-config") { |
| cm_label = ":blobfs.cml" |
| } |
| |
| fuchsia_structured_config_values("blobfs-component-config-values") { |
| cm_label = ":blobfs.cml" |
| values = { |
| pager_threads = blobfs_num_pager_threads |
| } |
| } |
| |
| # Include the .cm and .cvf in the bundle. Do not include bin/blobfs |
| # since that is included in the legacy bundle via //bundles:bootstrap-zedboot |
| bootfs_files_for_assembly("bootfs") { |
| deps = [ |
| ":blobfs-component-config-values", |
| ":blobfs.cml", |
| ] |
| } |
| |
| test("blobfs_component_test") { |
| sources = [ "blobfs_test.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp_wire", |
| "//sdk/fidl/fuchsia.fs:fuchsia.fs_cpp_wire", |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_cpp_wire", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_wire", |
| "//sdk/lib/component/incoming/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_cpp_wire", |
| "//src/storage/testing:storage_driver_test_support", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("blobfs-component-test-component") { |
| testonly = true |
| manifest = "meta/blobfs_component_test.cml" |
| deps = [ |
| ":blobfs_component_test", |
| "//src/storage/testing:storage_driver_test_realm", |
| ] |
| } |
| |
| fuchsia_test_package("blobfs-component-tests") { |
| test_components = [ ":blobfs-component-test-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":blobfs-component-tests" ] |
| } |