diff options
Diffstat (limited to 'recipes-containers/containerd/containerd_git.bb')
| -rw-r--r-- | recipes-containers/containerd/containerd_git.bb | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/recipes-containers/containerd/containerd_git.bb b/recipes-containers/containerd/containerd_git.bb new file mode 100644 index 00000000..4d900d01 --- /dev/null +++ b/recipes-containers/containerd/containerd_git.bb | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | HOMEPAGE = "https://github.com/containerd/containerd" | ||
| 2 | SUMMARY = "containerd is a daemon to control runC" | ||
| 3 | DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \ | ||
| 4 | containerd leverages runC's advanced features such as seccomp and user namespace \ | ||
| 5 | support as well as checkpoint and restore for cloning and live migration of containers." | ||
| 6 | |||
| 7 | |||
| 8 | SRCREV = "b1624c3628954e769dd50783b63823040b2db38c" | ||
| 9 | SRC_URI = "git://github.com/containerd/containerd;branch=main;protocol=https;destsuffix=git/src/github.com/containerd/containerd/v2 \ | ||
| 10 | file://0001-Makefile-allow-GO_BUILD_FLAGS-to-be-externally-speci.patch \ | ||
| 11 | file://0001-build-don-t-use-gcflags-to-define-trimpath.patch \ | ||
| 12 | file://0001-Makefile-update-default-PACKAGE-to-v2.patch \ | ||
| 13 | " | ||
| 14 | |||
| 15 | # Apache-2.0 for containerd | ||
| 16 | LICENSE = "Apache-2.0" | ||
| 17 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1269f40c0d099c21a871163984590d89" | ||
| 18 | |||
| 19 | CONTAINERD_VERSION = "v2.0.0-beta.0" | ||
| 20 | CVE_VERSION = "v2.0.0-beta.0" | ||
| 21 | |||
| 22 | # EXTRA_OEMAKE += "GODEBUG=1" | ||
| 23 | |||
| 24 | # containerd-opencontainers is to provide compatibility with external | ||
| 25 | # packagegroups / recipes that depend on the existing split of containerd | ||
| 26 | # between docker and opencontainers. We can drop it in the future. | ||
| 27 | PROVIDES += "virtual/containerd containerd-opencontainers" | ||
| 28 | RPROVIDES:${PN} = "virtual-containerd containerd-opencontainers" | ||
| 29 | |||
| 30 | S = "${WORKDIR}/git/src/github.com/containerd/containerd/v2" | ||
| 31 | |||
| 32 | PV = "${CONTAINERD_VERSION}+git" | ||
| 33 | |||
| 34 | inherit go | ||
| 35 | inherit goarch | ||
| 36 | |||
| 37 | GO_IMPORT = "import" | ||
| 38 | |||
| 39 | INSANE_SKIP:${PN} += "ldflags" | ||
| 40 | |||
| 41 | do_configure[noexec] = "1" | ||
| 42 | |||
| 43 | do_compile() { | ||
| 44 | export GOARCH="${TARGET_GOARCH}" | ||
| 45 | |||
| 46 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go:${WORKDIR}/git/" | ||
| 47 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
| 48 | |||
| 49 | # Pass the needed cflags/ldflags so that cgo | ||
| 50 | # can find the needed headers files and libraries | ||
| 51 | export CGO_ENABLED="1" | ||
| 52 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 53 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 54 | export BUILDTAGS="no_btrfs static_build netgo" | ||
| 55 | export CFLAGS="${CFLAGS}" | ||
| 56 | export LDFLAGS="${LDFLAGS}" | ||
| 57 | export SHIM_CGO_ENABLED="${CGO_ENABLED}" | ||
| 58 | # fixes: | ||
| 59 | # cannot find package runtime/cgo (using -importcfg) | ||
| 60 | # ... recipe-sysroot-native/usr/lib/aarch64-poky-linux/go/pkg/tool/linux_amd64/link: | ||
| 61 | # cannot open file : open : no such file or directory | ||
| 62 | export GO_BUILD_FLAGS="-trimpath -a -pkgdir dontusecurrentpkgs" | ||
| 63 | export GO111MODULE=off | ||
| 64 | |||
| 65 | cd ${S} | ||
| 66 | |||
| 67 | oe_runmake binaries | ||
| 68 | } | ||
| 69 | |||
| 70 | inherit systemd | ||
| 71 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
| 72 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}" | ||
| 73 | |||
| 74 | do_install() { | ||
| 75 | mkdir -p ${D}/${bindir} | ||
| 76 | |||
| 77 | cp ${S}/bin/containerd ${D}/${bindir}/containerd | ||
| 78 | cp ${S}/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2 | ||
| 79 | cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr | ||
| 80 | |||
| 81 | ln -sf containerd ${D}/${bindir}/docker-containerd | ||
| 82 | ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr | ||
| 83 | |||
| 84 | ln -sf containerd-ctr ${D}/${bindir}/ctr | ||
| 85 | |||
| 86 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 87 | install -d ${D}${systemd_unitdir}/system | ||
| 88 | install -m 644 ${S}/containerd.service ${D}/${systemd_unitdir}/system | ||
| 89 | # adjust from /usr/local/bin to /usr/bin/ | ||
| 90 | sed -e "s:/usr/local/bin/containerd:${bindir}/containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service | ||
| 91 | fi | ||
| 92 | } | ||
| 93 | |||
| 94 | FILES:${PN} += "${systemd_system_unitdir}/*" | ||
| 95 | |||
| 96 | INSANE_SKIP:${PN} += "ldflags already-stripped" | ||
| 97 | |||
| 98 | COMPATIBLE_HOST = "^(?!(qemu)?mips).*" | ||
| 99 | |||
| 100 | RDEPENDS:${PN} += " ${VIRTUAL-RUNTIME_container_runtime}" | ||
| 101 | |||
