Skip to contentSkip to conversation

containerd: make cni_networking conditional

PATCH Changqing Li 2 participants 2 messages Jun 9, 2025 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Kindly ping

//Changqing

Quoted 53 lines · Changqing Li via lists.yoctoproject.org

From: Changqing Li<[email protected]>

make cni_networking conditional, when k3s, k8s is enabled, the
networking configuration will be provided by the orchestration package,
containerd-cni is not needed. This is for fix the following error:
PACKAGE_CLASSES = "package_deb"
do_rootfs failed with error:
dpkg: error processing archive /path/to/oe-rootfs-repo/corei7-64/./kubernetes-cni_v1.32.0+git0+5fe148234f_release-r0.deb (--unpack):
trying to overwrite '/etc/cni/net.d/cni-containerd-net.conflist', which is also in package containerd-cni v2.0.5-r0

Refer [1], "--no-force-overwrite" is set for dpkg, so above error occurred.

[1]https://git.openembedded.org/openembedded-core/commit/?id=cb95ba079960411775c57ab864d266e15a6292d1

---
  recipes-containers/containerd/containerd_git.bb      | 2 +-
  recipes-core/packagegroups/packagegroup-container.bb | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
recipes-containers/containerd/containerd_git.bb +1 -1
index c683fbeb..def7591a 100644
@@ -102,4 +102,4 @@ RDEPENDS:${PN} += " ${VIRTUAL-RUNTIME_container_runtime}"
  ## This may need to be made conditional on K3S or similar being
  ## configured in the distro, since we may have collisions.
  CNI_NETWORKING_FILES ?= "${UNPACKDIR}/cni-containerd-net.conflist"
-inherit cni_networking
+inherit_defer ${@bb.utils.contains_any('DISTRO_FEATURES', 'k3s k8s', '', 'cni_networking', d)}
recipes-core/packagegroups/packagegroup-container.bb +1 -2
index f5e20344..8cbcf28e 100644
@@ -69,7 +69,7 @@ RDEPENDS:packagegroup-oci = " \
  RDEPENDS:packagegroup-containerd = " \
      virtual-containerd \
      packagegroup-cni \
-    containerd-cni \
+    ${@bb.utils.contains_any('DISTRO_FEATURES','k3s k8s','','containerd-cni',d)} \
      nerdctl \
      tini \
  "
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#9261):https://lists.yoctoproject.org/g/meta-virtualization/message/9261 Mute This Topic:https://lists.yoctoproject.org/mt/113339575/3616873
Group Owner:[email protected] Unsubscribe:https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Kindly read my reply to your patch.

I'm not merging this as it currently is.

Bruce

Quoted 63 lines · Changqing Li via lists.yoctoproject.org

Kindly ping

//Changqing
On 5/28/25 13:48, Changqing Li via lists.yoctoproject.org wrote:

From: Changqing Li <[email protected]> <[email protected]>

make cni_networking conditional, when k3s, k8s is enabled, the
networking configuration will be provided by the orchestration package,
containerd-cni is not needed. This is for fix the following error:
PACKAGE_CLASSES = "package_deb"
do_rootfs failed with error:
dpkg: error processing archive /path/to/oe-rootfs-repo/corei7-64/./kubernetes-cni_v1.32.0+git0+5fe148234f_release-r0.deb (--unpack):
trying to overwrite '/etc/cni/net.d/cni-containerd-net.conflist', which is also in package containerd-cni v2.0.5-r0

Refer [1], "--no-force-overwrite" is set for dpkg, so above error occurred.

[1] https://git.openembedded.org/openembedded-core/commit/?id=cb95ba079960411775c57ab864d266e15a6292d1

---
 recipes-containers/containerd/containerd_git.bb      | 2 +-
 recipes-core/packagegroups/packagegroup-container.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
recipes-containers/containerd/containerd_git.bb +1 -1
index c683fbeb..def7591a 100644
@@ -102,4 +102,4 @@ RDEPENDS:${PN} += " ${VIRTUAL-RUNTIME_container_runtime}"
 ## This may need to be made conditional on K3S or similar being
 ## configured in the distro, since we may have collisions.
 CNI_NETWORKING_FILES ?= "${UNPACKDIR}/cni-containerd-net.conflist"
-inherit cni_networking
+inherit_defer ${@bb.utils.contains_any('DISTRO_FEATURES', 'k3s k8s', '', 'cni_networking', d)}
recipes-core/packagegroups/packagegroup-container.bb +1 -2
index f5e20344..8cbcf28e 100644
@@ -69,7 +69,7 @@ RDEPENDS:packagegroup-oci = " \
 RDEPENDS:packagegroup-containerd = " \
     virtual-containerd \
     packagegroup-cni \
-    containerd-cni \
+    ${@bb.utils.contains_any('DISTRO_FEATURES','k3s k8s','','containerd-cni',d)} \
     nerdctl \
     tini \
 "
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group. View/Reply Online (#9274):
https://lists.yoctoproject.org/g/meta-virtualization/message/9274
Mute This Topic: https://lists.yoctoproject.org/mt/113339575/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II