podman: fix PACKAGECONFIG QA errors

bitbake now errors if PACKAGECONFIG is used, but doesn't have
entries for the possible values in the variable.

podman was using PACKAGECONFIG as a local feature variable in
one case (docker) and in the other, was later adding a RDEPEND
that could have been done via the packageconfig directly (rootless).

The docker issue is fixed by creating a PODMAN_FEATURES variable
and testing on it, and the rootless one is fixed by using
PACKAGECONFIG to add the rdepends

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2025-04-09 20:48:24 +00:00
parent 6ac3542bc7
commit cbe8ceb787

View File

@ -65,10 +65,13 @@ EXTRA_OEMAKE = " \
SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_user_unitdir} \ SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_user_unitdir} \
" "
# remove 'docker' from the packageconfig if you don't want podman to # remove 'docker' from the features if you don't want podman to
# build and install the docker wrapper. If docker is enabled in the # build and install the docker wrapper. If docker is enabled in the
# packageconfig, the podman package will rconfict with docker. # variable, the podman package will rconfict with docker.
PACKAGECONFIG ?= "docker" PODMAN_FEATURES ?= "docker"
PACKAGECONFIG ?= ""
PACKAGECONFIG[rootless] = ",,,fuse-overlayfs slirp4netns,,"
do_compile() { do_compile() {
cd ${S}/src cd ${S}/src
@ -106,7 +109,7 @@ do_install() {
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
oe_runmake install DESTDIR="${D}" oe_runmake install DESTDIR="${D}"
if ${@bb.utils.contains('PACKAGECONFIG', 'docker', 'true', 'false', d)}; then if ${@bb.utils.contains('PODMAN_FEATURES', 'docker', 'true', 'false', d)}; then
oe_runmake install.docker DESTDIR="${D}" oe_runmake install.docker DESTDIR="${D}"
fi fi
@ -156,7 +159,6 @@ COMPATIBLE_HOST = "^(?!mips).*"
RDEPENDS:${PN} += "\ RDEPENDS:${PN} += "\
catatonit conmon ${VIRTUAL-RUNTIME_container_runtime} iptables libdevmapper \ catatonit conmon ${VIRTUAL-RUNTIME_container_runtime} iptables libdevmapper \
${VIRTUAL-RUNTIME_container_dns} ${VIRTUAL-RUNTIME_container_networking} ${VIRTUAL-RUNTIME_base-utils-nsenter} \ ${VIRTUAL-RUNTIME_container_dns} ${VIRTUAL-RUNTIME_container_networking} ${VIRTUAL-RUNTIME_base-utils-nsenter} \
${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'fuse-overlayfs slirp4netns', '', d)} \
" "
RRECOMMENDS:${PN} += "slirp4netns \ RRECOMMENDS:${PN} += "slirp4netns \
kernel-module-xt-masquerade \ kernel-module-xt-masquerade \