| # 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") |
| |
| # Include the binary, .cm, and the .cvf in the bundle. |
| bootfs_files_for_assembly("bootfs") { |
| deps = [ |
| ":blobfs", |
| ":blobfs-component-config-values", |
| ":blobfs.cml", |
| ] |
| } |
| |
| visibility = [ "//src/storage/*" ] |
| |
| declare_args() { |
| # The number of pager threads to spawn for blobfs. |
| blobfs_num_pager_threads = 2 |
| } |
| |
| executable("blobfs") { |
| visibility += [ "//src/storage/lib/fs_management/cpp:fs-management-test" ] |
| 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/storage/blobfs", |
| "//src/storage/blobfs:decompressor-sandbox", |
| "//src/storage/lib/block_client/cpp", |
| "//src/storage/lib/vfs/cpp", |
| "//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" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":blobfs.cml" |
| deps = [ |
| ":blobfs", |
| ":blobfs-component-config-values", |
| ] |
| } |
| |
| # Prefer this over the previous target for tests because it includes the required fs_management |
| # shard. |
| group("blobfs-component") { |
| visibility += [ |
| "//src/recovery/system:*", |
| "//src/security/tests/pkg_test/fshost:*", |
| "//src/storage/lib/fs_management/rust:*", |
| "//src/sys/pkg/testing/blobfs-ramdisk:*", |
| "//tools/blackout/blobfs-checkerboard:*", |
| ] |
| deps = [ |
| ":component", |
| "//src/storage/lib/fs_management:fs_management_shard", |
| ] |
| } |
| |
| 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 |
| } |
| } |
| |
| 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" ] |
| } |