cni: move cni tools to /usr/libexec/cni

Use a standard location to store the cni tools and plugins. This
is more in line how other distributions package cni. Keep a symlink
to /opt/cni/bin for backward compatibility.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Stefan Agner 2019-09-20 09:18:05 +02:00 committed by Bruce Ashfield
parent 05db2367cc
commit aa509c629e
2 changed files with 7 additions and 3 deletions

View File

@ -144,4 +144,4 @@ registries = [
network_dir = "/etc/cni/net.d/"
# plugin_dir is is where CNI plugin binaries are stored.
plugin_dir = "/opt/cni/bin/"
plugin_dir = "/opt/cni/bin"

View File

@ -63,16 +63,20 @@ do_compile() {
}
do_install() {
localbindir="/opt/cni/bin"
localbindir="${libexecdir}/cni/"
install -d ${D}${localbindir}
install -d ${D}/${sysconfdir}/cni/net.d
install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir}
install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir}
# Parts of k8s expect the cni binaries to be available in /opt/cni
install -d ${D}/opt/cni
ln -sf ${libexecdir}/cni/ ${D}/opt/cni/bin
}
FILES_${PN} += "/opt/cni/bin/*"
FILES_${PN} += "${libexecdir}/cni/* /opt/cni/bin"
INSANE_SKIP_${PN} += "ldflags already-stripped"