Skip to contentSkip to conversation

podman: Use slirp4netns instead of pasta

PATCH In review Marcus Flyckt 2 participants 2 messages May 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 podman: Use slirp4netns instead of pasta

podman uses pasta as the default rootless network command since 5.0.0, but only slirp4netns is available when building for Yocto.

This commit adds a containers.conf file setting slirp4netns as default rootless command if 'rootless' is set in PACKAGECONFIG

---
 recipes-containers/podman/podman_git.bb | 5 +++++
 1 file changed, 5 insertions(+)
recipes-containers/podman/podman_git.bb +5 -0
index 32de3f0c..b8e90406 100644
@@ -117,6 +117,11 @@ do_install() {
 	if ${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'true', 'false', d)}; then
 		install -d "${D}${sysconfdir}/sysctl.d"
 		install -m 0644 "${WORKDIR}/50-podman-rootless.conf" "${D}${sysconfdir}/sysctl.d"
+		install -d "${D}${sysconfdir}/containers"
+		cat <<-EOF >> "${D}${sysconfdir}/containers/containers.conf"
+		[NETWORK]
+		default_rootless_network_cmd="slirp4netns"
+		EOF
 	fi
 }
 
Signature · 1 line
2.43.0
#1 lore raw

In message: [meta-virtualization][PATCH] podman: Use slirp4netns instead of pasta

Quoted 5 lines · on 31/05/2024 Marcus Flyckt via lists.yoctoproject.org wrote:

podman uses pasta as the default rootless network command since 5.0.0, but only slirp4netns is available when building for Yocto.

This commit adds a containers.conf file setting slirp4netns as default rootless command if 'rootless' is set in PACKAGECONFIG

That is also my preferred default.

That being said, I was doing a recipe for pasta, if anyone knows of an existing recipe that I'm not aware of, let me know!

Bruce

Quoted 35 lines
---
 recipes-containers/podman/podman_git.bb | 5 +++++
 1 file changed, 5 insertions(+)
recipes-containers/podman/podman_git.bb +5 -0
index 32de3f0c..b8e90406 100644
@@ -117,6 +117,11 @@ do_install() {
 	if ${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'true', 'false', d)}; then
 		install -d "${D}${sysconfdir}/sysctl.d"
 		install -m 0644 "${WORKDIR}/50-podman-rootless.conf" "${D}${sysconfdir}/sysctl.d"
+		install -d "${D}${sysconfdir}/containers"
+		cat <<-EOF >> "${D}${sysconfdir}/containers/containers.conf"
+		[NETWORK]
+		default_rootless_network_cmd="slirp4netns"
+		EOF
 	fi
 }
 
Signature · 11 lines
2.43.0



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