| # Copyright 2026 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. | |
| load("//build/bazel/rules/bind:driver_bind_bytecode.bzl", "driver_bind_bytecode") | |
| load("//build/bazel/rules/drivers:dml_outputs.bzl", "dml_outputs") | |
| load("//build/bazel/rules/drivers:driver_component.bzl", "driver_component") | |
| load("//build/bazel/rules/drivers:rust_driver.bzl", "rust_driver") | |
| load("//build/bazel/rules/packages:fx_package.bzl", "fx_package") | |
| package(default_applicable_licenses = ["//:license"]) | |
| dml_outputs( | |
| name = "ramdisk-dml", | |
| dml = "meta/ramdisk.dml", | |
| driver_name = "ramdisk", | |
| ) | |
| driver_bind_bytecode( | |
| name = "ramdisk_bind", | |
| bind_output = "ramdisk.bindbc", | |
| dml = ":ramdisk-dml", | |
| deps = ["//src/devices/bind/fuchsia"], | |
| ) | |
| rust_driver( | |
| name = "ramdisk-driver", | |
| srcs = [ | |
| "src/lib.rs", | |
| "src/ramdisk.rs", | |
| ], | |
| edition = "2024", | |
| output_name = "ramdisk", | |
| deps = [ | |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_rust_next", | |
| "//sdk/fidl/fuchsia.driver.token:fuchsia.driver.token_rust", | |
| "//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust", | |
| "//sdk/fidl/fuchsia.hardware.ramdisk:fuchsia.hardware.ramdisk_rust", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/fidl/fuchsia.storage.block:fuchsia.storage.block_rust", | |
| "//sdk/lib/driver/component/rust", | |
| "//sdk/rust/zx", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fidl/rust_next/fidl_next", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-component", | |
| "//src/storage/lib/block_protocol", | |
| "//src/storage/lib/block_server", | |
| "//src/storage/lib/vfs/rust:vfs", | |
| "//third_party/rust_crates/vendor:futures", | |
| "//third_party/rust_crates/vendor:log", | |
| "//third_party/rust_crates/vendor:rand", | |
| "//third_party/rust_crates/vendor:scopeguard", | |
| ], | |
| ) | |
| driver_component( | |
| name = "ramdisk", | |
| component_name = "ramdisk", | |
| dml = ":ramdisk-dml", | |
| visibility = [ | |
| "//build/bazel/rules/drivers:__pkg__", | |
| "//src/bringup/bin/device-name-provider/tests:__pkg__", | |
| "//src/devices/block:__pkg__", | |
| "//src/firmware/paver/test:__pkg__", | |
| "//src/storage/fvm:__pkg__", | |
| "//src/storage/testing:__pkg__", | |
| ], | |
| deps = [ | |
| ":ramdisk-driver", | |
| ":ramdisk_bind", | |
| ], | |
| ) | |
| fx_package( | |
| name = "package", | |
| package_name = "ramdisk", | |
| components = [":ramdisk"], | |
| ) |