From 5dfe66298a6ba94bd879d4f173dda8d74f5e989d Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 29 Oct 2024 14:48:49 +0000 Subject: crun: conditionally offer runc binary via symlink When integrating into some container stacks (such as containerd), the detailed configuration toml changes to change the container runtime from runc to crun is not always trivial. To avoid (for now) carrying configuration snippets as part of the recipes, we can symlink runc to crun as crun is fully compatible with runc. Note: this means you can't have runc and crun installed on the same image if the symlinking is done. Hence why this symlinking is conditional. Signed-off-by: Bruce Ashfield --- recipes-containers/crun/crun_git.bb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes-containers/crun/crun_git.bb b/recipes-containers/crun/crun_git.bb index 5e25bd74..e9f8f58d 100644 --- a/recipes-containers/crun/crun_git.bb +++ b/recipes-containers/crun/crun_git.bb @@ -22,6 +22,10 @@ S = "${WORKDIR}/git" inherit autotools-brokensep pkgconfig +# if this is true, we'll symlink crun to runc for easier integration +# with container stacks +CRUN_AS_RUNC ?= "true" + PACKAGECONFIG ??= " \ caps external-yajl man \ ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)} \ @@ -47,4 +51,7 @@ do_configure:prepend () { do_install() { oe_runmake 'DESTDIR=${D}' install + if [ -n "${CRUN_AS_RUNC}" ]; then + ln -sr "${D}/${bindir}/crun" "${D}${bindir}/runc" + fi } -- cgit v1.2.3-54-g00ecf