From 115184e6c9dbca661c3359f039f88faa76a72b4f Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 17 Apr 2026 09:31:34 +0200 Subject: 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 Signed-off-by: Bruce Ashfield --- recipes-containers/cdi/cdi_git.bb | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 recipes-containers/cdi/cdi_git.bb (limited to 'recipes-containers/cdi/cdi_git.bb') 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 @@ +DESCRIPTION = "The cdi command-line tool is a utility for inspecting and interacting with the CDI (Container Device Interface) cache." +SUMMARY = "The cdi command-line tool." +HOMEPAGE = "https://github.com/cncf-tags/container-device-interface" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +PV = "1.1.0+git" +SRCREV_cdi = "35765bd41b50a86aa3919eb352bc90321e010e68" +SRCREV_FORMAT = "cdi" +SRC_URI = "git://github.com/cncf-tags/container-device-interface.git;protocol=https;name=cdi;branch=main;destsuffix=${GO_SRCURI_DESTSUFFIX} \ + " +SRCREV_FORMAT = "cdi" + +GO_IMPORT = "tags.cncf.io/container-device-interface/" + +inherit go goarch + +# GO_MOD_FETCH_MODE: "vcs" (all git://) or "hybrid" (gomod:// + git://) +GO_MOD_FETCH_MODE ?= "hybrid" + +# VCS mode: all modules via git:// +include ${@ "go-mod-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} +include ${@ "go-mod-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} + +# Hybrid mode: gomod:// for most, git:// for selected +include ${@ "go-mod-hybrid-gomod.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} +include ${@ "go-mod-hybrid-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} +include ${@ "go-mod-hybrid-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} + +do_compile() { + cd ${S}/src/${GO_IMPORT} + sed -i -e 's:GO_EXTRAFLAGS:GOBUILDFLAGS:g' Makefile + oe_runmake +} + +do_install() { + install -d "${D}${bindir}" + install -m 755 ${S}/src/${GO_IMPORT}/bin/* "${D}${bindir}" +} -- cgit v1.2.3-54-g00ecf