containerd: uprev to latest 0.2.x

To match the docker (moby) and runc updates, we need the latest containerd
from the 0.2.x branch to work in cooperation with the other components.

Note: containerd master won't currently work with docker master, but is
very similar to 0.2.x. The build target varies slightly in master, but
otherwise with these changes to the recipe and build steps we can switch
easily when the time comes.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Bruce Ashfield 2017-07-17 12:04:23 -04:00
parent e4d0007121
commit 3b9dbb0075
3 changed files with 32 additions and 23 deletions

View File

@ -1,10 +1,14 @@
SRCREV = "3addd840653146c90a254301d6c3a663c7fd6429"
SRC_URI = "\
git://github.com/docker/containerd.git;branch=v0.2.x;destsuffix=git/src/github.com/containerd/containerd \
"
include containerd.inc include containerd.inc
SRCREV = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e" CONTAINERD_VERSION = "v0.2.x"
SRC_URI = "\ S = "${WORKDIR}/git/src/github.com/containerd/containerd"
git://github.com/docker/containerd.git;branch=docker-1.13.x \
"
CONTAINERD_VERSION = "0.2.3"
PROVIDES += "virtual/containerd" PROVIDES += "virtual/containerd"
RPROVIDES_${PN} = "virtual/containerd" RPROVIDES_${PN} = "virtual/containerd"
DEPENDS += "btrfs-tools"

View File

@ -8,30 +8,23 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and
LICENSE = "Apache-2.0" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
SRC_URI += "file://containerd.service"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
PV = "${CONTAINERD_VERSION}+git${SRCREV}" PV = "${CONTAINERD_VERSION}+git${SRCREV}"
inherit go inherit go
inherit goarch
RRECOMMENDS_${PN} = "lxc docker" RRECOMMENDS_${PN} = "lxc docker"
CONTAINERD_PKG="github.com/docker/containerd" CONTAINERD_PKG="github.com/containerd/containerd"
INSANE_SKIP_${PN} += "ldflags"
do_configure[noexec] = "1" do_configure[noexec] = "1"
do_compile() { do_compile() {
export GOARCH="${TARGET_ARCH}"
# supported amd64, 386, arm arm64
if [ "${TARGET_ARCH}" = "x86_64" ]; then
export GOARCH="amd64"
fi
if [ "${TARGET_ARCH}" = "aarch64" ]; then
export GOARCH="arm64"
fi
if [ "${TARGET_ARCH}" = "i586" ]; then
export GOARCH="386"
fi
# Set GOPATH. See 'PACKAGERS.md'. Don't rely on # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
# docker to download its dependencies but rather # docker to download its dependencies but rather
# use dependencies packaged independently. # use dependencies packaged independently.
@ -39,9 +32,9 @@ do_compile() {
rm -rf .gopath rm -rf .gopath
mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")" mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")"
ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}" ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}"
export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" export GOPATH="${WORKDIR}/git/"
cd - export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
# Pass the needed cflags/ldflags so that cgo # Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries # can find the needed headers files and libraries
@ -50,6 +43,7 @@ do_compile() {
export LDFLAGS="" export LDFLAGS=""
export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export GO_GCFLAGS=""
export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
@ -74,9 +68,9 @@ do_install() {
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system install -d ${D}${systemd_unitdir}/system
install -m 644 ${S}/hack/containerd.service ${D}/${systemd_unitdir}/system install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system
# adjust from /usr/local/bin to /usr/bin/ # adjust from /usr/local/bin to /usr/bin/
sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd -l \"unix\:///var/run/docker/libcontainerd/docker-containerd.sock\":g" -i ${D}/${systemd_unitdir}/system/containerd.service sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service
fi fi
} }

View File

@ -0,0 +1,11 @@
[Unit]
Description=containerd
Documentation=https://containerd.tools
After=network.target
[Service]
ExecStart=/usr/local/bin/containerd
Delegate=yes
[Install]
WantedBy=multi-user.target