diff options
| author | Koen Kooi <koen.kooi@oss.qualcomm.com> | 2026-04-17 09:31:34 +0200 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-04-21 02:30:58 +0000 |
| commit | 115184e6c9dbca661c3359f039f88faa76a72b4f (patch) | |
| tree | 048e0e162f5a15d918b4a0b419bf6baa0f0b0ecb /recipes-containers/cdi/cdi_git.bb | |
| parent | c83f423bfed7963d2f98276f8cd5d13f2cfda4ca (diff) | |
| download | meta-virtualization-115184e6c9dbca661c3359f039f88faa76a72b4f.tar.gz | |
cdi: add container-device-interface commandline utility
From the upstream description:
The `cdi` command-line tool is a utility for inspecting and interacting with the CDI (Container Device Interface) cache.
It allows developers and system administrators to:
- List CDI Spec files: View all available CDI specification files in the configured directories
- List vendors: Display registered device vendors in the CDI cache
- List device classes: Show available device classes from CDI Specs
- List devices: Enumerate all CDI devices available in the system
- Validate specs: Verify CDI specification files against the JSON schema
- Inject devices: Inject CDI device configurations into OCI runtime specifications
- Monitor cache: Watch for changes in the CDI cache and Spec directories
- Resolve devices: Resolve fully-qualified device names to their configurations
The CLI tool is particularly useful for debugging CDI configurations, validating spec files, and testing device assignments before deploying them in production environments.
Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/cdi/cdi_git.bb')
| -rw-r--r-- | recipes-containers/cdi/cdi_git.bb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/recipes-containers/cdi/cdi_git.bb b/recipes-containers/cdi/cdi_git.bb new file mode 100644 index 00000000..acdfb7ad --- /dev/null +++ b/recipes-containers/cdi/cdi_git.bb | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | DESCRIPTION = "The cdi command-line tool is a utility for inspecting and interacting with the CDI (Container Device Interface) cache." | ||
| 2 | SUMMARY = "The cdi command-line tool." | ||
| 3 | HOMEPAGE = "https://github.com/cncf-tags/container-device-interface" | ||
| 4 | |||
| 5 | LICENSE = "Apache-2.0" | ||
| 6 | LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
| 7 | |||
| 8 | PV = "1.1.0+git" | ||
| 9 | SRCREV_cdi = "35765bd41b50a86aa3919eb352bc90321e010e68" | ||
| 10 | SRCREV_FORMAT = "cdi" | ||
| 11 | SRC_URI = "git://github.com/cncf-tags/container-device-interface.git;protocol=https;name=cdi;branch=main;destsuffix=${GO_SRCURI_DESTSUFFIX} \ | ||
| 12 | " | ||
| 13 | SRCREV_FORMAT = "cdi" | ||
| 14 | |||
| 15 | GO_IMPORT = "tags.cncf.io/container-device-interface/" | ||
| 16 | |||
| 17 | inherit go goarch | ||
| 18 | |||
| 19 | # GO_MOD_FETCH_MODE: "vcs" (all git://) or "hybrid" (gomod:// + git://) | ||
| 20 | GO_MOD_FETCH_MODE ?= "hybrid" | ||
| 21 | |||
| 22 | # VCS mode: all modules via git:// | ||
| 23 | include ${@ "go-mod-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} | ||
| 24 | include ${@ "go-mod-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} | ||
| 25 | |||
| 26 | # Hybrid mode: gomod:// for most, git:// for selected | ||
| 27 | include ${@ "go-mod-hybrid-gomod.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 28 | include ${@ "go-mod-hybrid-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 29 | include ${@ "go-mod-hybrid-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 30 | |||
| 31 | do_compile() { | ||
| 32 | cd ${S}/src/${GO_IMPORT} | ||
| 33 | sed -i -e 's:GO_EXTRAFLAGS:GOBUILDFLAGS:g' Makefile | ||
| 34 | oe_runmake | ||
| 35 | } | ||
| 36 | |||
| 37 | do_install() { | ||
| 38 | install -d "${D}${bindir}" | ||
| 39 | install -m 755 ${S}/src/${GO_IMPORT}/bin/* "${D}${bindir}" | ||
| 40 | } | ||
