No description
  • Rust 63.9%
  • Meson 21.4%
  • Shell 14.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Roberto Majadas ace2670fcb ci(packit): Add EPEL and aarch64 targets
Expand the COPR build matrix to include EPEL 9, EPEL 10, and aarch64 builds for Fedora and EPEL

Signed-off-by: Roberto Majadas <rmajadas@redhat.com>
2025-10-02 14:54:53 +02:00
.github/workflows feat: Initial core logic for udev device binding 2025-09-14 14:28:36 +02:00
data feat(udev): Bind devices based on annotations 2025-09-23 10:07:51 +02:00
rpm feat: Add option to disable udev required tests 2025-10-02 13:03:00 +02:00
src feat: Add option to disable udev required tests 2025-10-02 13:03:00 +02:00
tools feat(rpm): Add support for building SRPMs 2025-10-01 11:52:58 +02:00
.gitignore feat: Initial project setup and CI 2025-09-11 13:46:12 +02:00
.packit.yaml ci(packit): Add EPEL and aarch64 targets 2025-10-02 14:54:53 +02:00
.pre-commit-config.yaml feat: Initial project setup and CI 2025-09-11 13:46:12 +02:00
Cargo.lock feat: Initial core logic for udev device binding 2025-09-14 14:28:36 +02:00
Cargo.toml feat: Add option to disable udev required tests 2025-10-02 13:03:00 +02:00
cliff.toml feat(changelog): Add git-cliff configuration file 2025-09-11 14:17:21 +02:00
deny.toml feat: Initial core logic for udev device binding 2025-09-14 14:28:36 +02:00
LICENSE Initial commit 2025-09-09 15:49:34 +02:00
meson.build feat(rpm): Add support for building SRPMs 2025-10-01 11:52:58 +02:00
meson_options.txt feat: Add option to disable udev required tests 2025-10-02 13:03:00 +02:00
README.md docs(readme): Add usage instructions to the README 2025-09-23 10:07:51 +02:00
rustfmt.toml feat: Initial project setup and CI 2025-09-11 13:46:12 +02:00

oci-dev-binder-hook

The OCI Device Binder is a generic OCI runtime hook that can be used with any container runtime that supports OCI hooks. It provides dynamic device access management based on container annotations.

Usage

The oci-dev-binder-hook can be used to enrich a container's available devices by using OCI annotations.

With Quadlets

For example, you can use a quadlet file for podman to inject all the devices that belongs to a given seat.

To do so, you can create a file /etc/containers/systemd/mycontainer.container with the following content:

[Container]
Image=<image>
Annotation=io.dev-binder.udev.seat=seat0

Then, when you run a container by enabling the mycontainer.service systemd unit, the hook will inject all the devices that belongs to the seat0 seat into the container.

With Podman CLI

Alternatively, you can achieve the same result using the podman command-line interface directly:

podman run --annotation io.dev-binder.udev.seat=seat0 -it <image>

This command will trigger the hook, which will then inject all the devices associated with the seat0 seat into the container.

Building

To build the project, run the following command:

cargo build

Building with Meson

It is also possible to build the project using Meson. This is useful for packagers and developers who want to integrate the project with other Meson-based projects.

First, ensure you have Meson installed. You can find installation instructions on the Meson website.

Once you have Meson installed, you can build the project using the following commands:

meson setup build --prefix=/usr
meson compile -C build

To install the project, you can use the following command:

meson install -C build

Testing

To run the test suite, use the following command:

cargo nextest run

Development Environment

This project uses a few cargo extensions to ensure code quality and consistency. Please install the following tools:

  • cargo-sort: To check that Cargo.toml is sorted.
  • cargo-machete: To find unused dependencies.
  • cargo-deny: To check for security vulnerabilities and license compatibility.
  • cargo-nextest: For running tests.
  • cargo-llvm-cov: For generating code coverage reports.

You can install them using the following command:

cargo install cargo-sort cargo-machete cargo-deny cargo-nextest cargo-llvm-cov

Code Coverage

To generate a code coverage report, you can use cargo-llvm-cov. It will use cargo-nextest under the hood.

First, ensure you have cargo-llvm-cov installed by following the instructions in the "Development Environment" section. You may also need to install the llvm-tools-preview component:

rustup component add llvm-tools-preview

Run the following command to obtain the coverage report

cargo llvm-cov nextest