summaryrefslogtreecommitdiffstats
path: root/recipes-networking/cni/cni_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/cni/cni_git.bb')
-rw-r--r--recipes-networking/cni/cni_git.bb41
1 files changed, 28 insertions, 13 deletions
diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb
index b41b47cf..4714e751 100644
--- a/recipes-networking/cni/cni_git.bb
+++ b/recipes-networking/cni/cni_git.bb
@@ -9,17 +9,18 @@ Because of this focus, CNI has a wide range of support and the specification \
9is simple to implement. \ 9is simple to implement. \
10" 10"
11 11
12SRCREV_cni = "b62753aa2bfa365c1ceaff6f25774a8047c896b5" 12SRCREV_cni = "4c9ae43c0eaa85ec1ab27781e9b258f13e7fd0ca"
13SRCREV_plugins = "b6a0e0bc96906f0d3bd6bfcaab0b5ae72292f46c" 13SRCREV_plugins = "35831f3d23956658aaa3109cbae0ce24d28137e6"
14SRCREV_flannel_plugin = "6464faacf5c00e25321573225d74638455ef03a0" 14SRCREV_flannel_plugin = "cc21427ce5b2c606ba5ececa0a488452e80d73f8"
15SRCREV_FORMAT = "cni_plugins" 15SRCREV_FORMAT = "cni_plugins"
16SRC_URI = "\ 16SRC_URI = "\
17 git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https \ 17 git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \
18 git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${S}/src/github.com/containernetworking/plugins;name=plugins;protocol=https \ 18 file://modules.txt \
19 git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${S}/src/github.com/containernetworking/plugins/plugins/meta/flannel \
20 file://modules.txt \
21 " 19 "
22 20
21SRC_URI += "git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${GO_SRCURI_DESTSUFFIX}/src/github.com/containernetworking/plugins;name=plugins;protocol=https"
22SRC_URI += "git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}/src/github.com/containernetworking/plugins/plugins/meta/flannel"
23
23# generated via: 24# generated via:
24# ./scripts/oe-go-mod-autogen.py --repo https://github.com/containernetworking/cni.git --rev <insert your rev here> 25# ./scripts/oe-go-mod-autogen.py --repo https://github.com/containernetworking/cni.git --rev <insert your rev here>
25include src_uri.inc 26include src_uri.inc
@@ -33,8 +34,8 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464
33 34
34GO_IMPORT = "import" 35GO_IMPORT = "import"
35 36
36PV = "v1.2.0-rc0+git${SRCREV_cni}" 37PV = "v1.2.3+git"
37CNI_VERSION = "v1.2.0" 38CNI_VERSION = "v1.2.3"
38 39
39inherit go 40inherit go
40inherit goarch 41inherit goarch
@@ -49,11 +50,19 @@ do_compile() {
49 mkdir -p ${S}/src/github.com/containernetworking 50 mkdir -p ${S}/src/github.com/containernetworking
50 ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni 51 ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni
51 52
53 # Fixes: cannot find package "github.com/containernetworking/plugins/plugins/meta/bandwidth" in any of:
54 # we can't clone the plugin source directly to where it belongs because
55 # there seems to be an issue in the relocation code from UNPACKDIR to S
56 # and our LICENSE file is never found.
57 # This symbolic link arranges for the code to be available where go will
58 # search during the build
59 ln -sfr ${S}/src/import/src/github.com/containernetworking/plugins ${B}/src/github.com/containernetworking
60
52 # our copied .go files are to be used for the build 61 # our copied .go files are to be used for the build
53 ln -sf vendor.copy vendor 62 ln -sf vendor.copy vendor
54 63
55 # inform go that we know what we are doing 64 # inform go that we know what we are doing
56 cp ${WORKDIR}/modules.txt vendor/ 65 cp ${UNPACKDIR}/modules.txt vendor/
57 66
58 export GO111MODULE=off 67 export GO111MODULE=off
59 68
@@ -63,7 +72,7 @@ do_compile() {
63 cd ${B}/src/github.com/containernetworking/cni/cnitool 72 cd ${B}/src/github.com/containernetworking/cni/cnitool
64 ${GO} build ${GOBUILDFLAGS} 73 ${GO} build ${GOBUILDFLAGS}
65 74
66 cd ${B}/src/github.com/containernetworking/plugins 75 cd ${B}/src/import/src/github.com/containernetworking/plugins
67 PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" 76 PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)"
68 mkdir -p ${B}/plugins/bin/ 77 mkdir -p ${B}/plugins/bin/
69 for p in $PLUGINS; do 78 for p in $PLUGINS; do
@@ -84,15 +93,21 @@ do_install() {
84 install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} 93 install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir}
85 install -m 755 -D ${B}/plugins/bin/* ${D}/${localbindir} 94 install -m 755 -D ${B}/plugins/bin/* ${D}/${localbindir}
86 95
96 # make cnitool more available on the path
97 install -d ${D}${bindir}
98 ln -sr ${D}/${localbindir}/cnitool ${D}/${bindir}
99
87 # Parts of k8s expect the cni binaries to be available in /opt/cni 100 # Parts of k8s expect the cni binaries to be available in /opt/cni
88 install -d ${D}/opt/cni 101 install -d ${D}/opt/cni
89 ln -sf ${libexecdir}/cni/ ${D}/opt/cni/bin 102 ln -sf ${libexecdir}/cni/ ${D}/opt/cni/bin
90} 103}
91 104
105PACKAGECONFIG ?= "ca-certs"
106PACKAGECONFIG[ca-certs] = ",,,ca-certificates"
107
92FILES:${PN} += "${libexecdir}/cni/* /opt/cni/bin" 108FILES:${PN} += "${libexecdir}/cni/* /opt/cni/bin"
93 109
94INSANE_SKIP:${PN} += "ldflags already-stripped" 110INSANE_SKIP:${PN} += "ldflags already-stripped"
95 111
96deltask compile_ptest_base 112deltask compile_ptest_base
97 113RRECOMMENDS:${PN} += "iptables iproute2"
98RDEPENDS:${PN} += " ca-certificates"