All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH v2] crun: honour CRUN_AS_RUNC
       [not found] <20260919173559.1598000-1-royzah@gmail.com>
@ 2026-09-19 18:39 ` Royyan Zahir
  2026-09-23 16:10   ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Royyan Zahir @ 2026-09-19 18:39 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Bruce Ashfield

CRUN_AS_RUNC = "false" installs the /usr/bin/runc symlink anyway. Both
guards read the string as true: the shell one because -n tests for a
non-empty string, the python one because a non-empty str is truthy. The
only way to disable the symlink today is to set the variable empty.

Normalize once with bb.utils.to_boolean() and use that in both places.

to_boolean() rejects values outside y/yes/1/true and n/no/0/false, so a
config setting CRUN_AS_RUNC to anything else now fails to parse instead
of silently enabling the symlink.

Signed-off-by: Royyan Zahir <royzah@gmail.com>
---
v2: drop the RPROVIDES virtual-runc hunk and the RCONFLICTS comment
    rewording, per Bruce.

 recipes-containers/crun/crun_git.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/recipes-containers/crun/crun_git.bb b/recipes-containers/crun/crun_git.bb
index 288c953..97c6603 100644
--- a/recipes-containers/crun/crun_git.bb
+++ b/recipes-containers/crun/crun_git.bb
@@ -31,6 +31,10 @@ CLEANBROKEN = "1"
 # with container stacks
 CRUN_AS_RUNC ?= "true"
 
+# Normalized once: a bare "false" is a non-empty string and would otherwise
+# read as true in both the shell test and the python expansion below.
+CRUN_AS_RUNC_ENABLED = "${@'1' if bb.utils.to_boolean(d.getVar('CRUN_AS_RUNC')) else ''}"
+
 PACKAGECONFIG ??= " \
     caps external-yajl man \
     ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)} \
@@ -56,13 +60,13 @@ do_configure:prepend () {
 
 do_install() {
     oe_runmake 'DESTDIR=${D}' install
-    if [ -n "${CRUN_AS_RUNC}" ]; then
+    if [ -n "${CRUN_AS_RUNC_ENABLED}" ]; then
         ln -sr "${D}/${bindir}/crun" "${D}${bindir}/runc"
     fi
 }
 
 # When crun provides /usr/bin/runc symlink, it conflicts with the runc package
-RCONFLICTS:${PN} = "${@'runc' if d.getVar('CRUN_AS_RUNC') else ''}"
+RCONFLICTS:${PN} = "${@'runc' if d.getVar('CRUN_AS_RUNC_ENABLED') else ''}"
 
 REQUIRED_DISTRO_FEATURES:class-native ?= ""
 DEPENDS:class-native += "yajl libcap go-md2man m4 libseccomp"
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-virtualization][PATCH v2] crun: honour CRUN_AS_RUNC
  2026-09-19 18:39 ` [meta-virtualization][PATCH v2] crun: honour CRUN_AS_RUNC Royyan Zahir
@ 2026-09-23 16:10   ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2026-09-23 16:10 UTC (permalink / raw)
  To: meta-virtualization; +Cc: royzah

merged

Bruce


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260919173559.1598000-1-royzah@gmail.com>
2026-09-19 18:39 ` [meta-virtualization][PATCH v2] crun: honour CRUN_AS_RUNC Royyan Zahir
2026-09-23 16:10   ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.