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 <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2024-10-29 14:48:49 +00:00
parent e2c3d012f9
commit 5dfe66298a

View File

@ -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
}