diff options
-rw-r--r-- | recipes-containers/containerd/containerd-docker_git.bb | 22 | ||||
-rw-r--r-- | recipes-containers/containerd/containerd-opencontainers_git.bb | 106 | ||||
-rw-r--r-- | recipes-containers/containerd/containerd.inc | 105 |
3 files changed, 104 insertions, 129 deletions
diff --git a/recipes-containers/containerd/containerd-docker_git.bb b/recipes-containers/containerd/containerd-docker_git.bb deleted file mode 100644 index 8d1a27aa..00000000 --- a/recipes-containers/containerd/containerd-docker_git.bb +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | SRCREV = "3addd840653146c90a254301d6c3a663c7fd6429" | ||
2 | SRC_URI = "\ | ||
3 | git://github.com/docker/containerd.git;branch=v0.2.x;destsuffix=git/src/github.com/containerd/containerd \ | ||
4 | " | ||
5 | |||
6 | |||
7 | LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" | ||
8 | |||
9 | include containerd.inc | ||
10 | |||
11 | CONTAINERD_VERSION = "v0.2.x" | ||
12 | S = "${WORKDIR}/git/src/github.com/containerd/containerd" | ||
13 | |||
14 | PROVIDES += "virtual/containerd" | ||
15 | RPROVIDES_${PN} = "virtual/containerd" | ||
16 | |||
17 | DEPENDS += "btrfs-tools" | ||
18 | |||
19 | do_compile_prepend() { | ||
20 | bberror "${PN} is depreciated and will be removed in the future" | ||
21 | bbfatal "use container-opencontainers for a working configuration" | ||
22 | } | ||
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb index 01e2cc78..e9f43ea9 100644 --- a/recipes-containers/containerd/containerd-opencontainers_git.bb +++ b/recipes-containers/containerd/containerd-opencontainers_git.bb | |||
@@ -1,11 +1,19 @@ | |||
1 | HOMEPAGE = "https://github.com/docker/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 | |||
1 | SRCREV = "33d90b72d1e44987118ac111d4f7a108d412099b" | 8 | SRCREV = "33d90b72d1e44987118ac111d4f7a108d412099b" |
2 | SRC_URI = "git://github.com/containerd/containerd;branch=release/1.4 \ | 9 | SRC_URI = "git://github.com/containerd/containerd;branch=release/1.4 \ |
3 | file://0001-build-use-oe-provided-GO-and-flags.patch \ | 10 | file://0001-build-use-oe-provided-GO-and-flags.patch \ |
4 | file://0001-Add-build-option-GODEBUG-1.patch \ | 11 | file://0001-Add-build-option-GODEBUG-1.patch \ |
12 | file://containerd.service \ | ||
5 | " | 13 | " |
6 | 14 | ||
7 | include containerd.inc | 15 | # Apache-2.0 for containerd |
8 | 16 | LICENSE = "Apache-2.0" | |
9 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89" | 17 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89" |
10 | 18 | ||
11 | CONTAINERD_VERSION = "v1.4.3" | 19 | CONTAINERD_VERSION = "v1.4.3" |
@@ -14,3 +22,97 @@ EXTRA_OEMAKE += "GODEBUG=1" | |||
14 | 22 | ||
15 | PROVIDES += "virtual/containerd" | 23 | PROVIDES += "virtual/containerd" |
16 | RPROVIDES_${PN} = "virtual/containerd" | 24 | RPROVIDES_${PN} = "virtual/containerd" |
25 | |||
26 | |||
27 | S = "${WORKDIR}/git" | ||
28 | |||
29 | PV = "${CONTAINERD_VERSION}+git${SRCPV}" | ||
30 | |||
31 | inherit go | ||
32 | inherit goarch | ||
33 | |||
34 | GO_IMPORT = "import" | ||
35 | |||
36 | CONTAINERD_PKG="github.com/containerd/containerd" | ||
37 | |||
38 | INSANE_SKIP_${PN} += "ldflags" | ||
39 | |||
40 | do_configure[noexec] = "1" | ||
41 | |||
42 | do_compile() { | ||
43 | export GOARCH="${TARGET_GOARCH}" | ||
44 | |||
45 | # link fixups for compilation | ||
46 | rm -f ${S}/src/import/vendor/src | ||
47 | ln -sf ./ ${S}/src/import/vendor/src | ||
48 | |||
49 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/ | ||
50 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/pkg/ | ||
51 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/contrib/ | ||
52 | # without this, the stress test parts of the build fail | ||
53 | cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd | ||
54 | |||
55 | for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \ | ||
56 | protobuf reference diff platforms runtime remotes version archive dialer gc metadata \ | ||
57 | metrics filters identifiers labels leases plugin server services \ | ||
58 | cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do | ||
59 | if [ -d ${S}/src/import/${c} ]; then | ||
60 | ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c} | ||
61 | fi | ||
62 | if [ -d ${S}/src/import/pkg/${c} ]; then | ||
63 | ln -sfn ${S}/src/import/pkg/${c} ${S}/src/import/vendor/github.com/containerd/containerd/pkg/${c} | ||
64 | fi | ||
65 | if [ -d ${S}/src/import/contrib/${c} ]; then | ||
66 | ln -sfn ${S}/src/import/contrib/${c} ${S}/src/import/vendor/github.com/containerd/containerd/contrib/${c} | ||
67 | fi | ||
68 | done | ||
69 | |||
70 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
71 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
72 | |||
73 | # Pass the needed cflags/ldflags so that cgo | ||
74 | # can find the needed headers files and libraries | ||
75 | export CGO_ENABLED="1" | ||
76 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
77 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
78 | export BUILDTAGS="no_btrfs static_build netgo" | ||
79 | export CFLAGS="${CFLAGS}" | ||
80 | export LDFLAGS="${LDFLAGS}" | ||
81 | export SHIM_CGO_ENABLED="${CGO_ENABLED}" | ||
82 | |||
83 | cd ${S}/src/import | ||
84 | oe_runmake binaries | ||
85 | } | ||
86 | |||
87 | inherit systemd | ||
88 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
89 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}" | ||
90 | |||
91 | do_install() { | ||
92 | mkdir -p ${D}/${bindir} | ||
93 | |||
94 | cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd | ||
95 | cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim | ||
96 | cp ${S}/src/import/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1 | ||
97 | cp ${S}/src/import/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2 | ||
98 | cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr | ||
99 | |||
100 | ln -sf containerd ${D}/${bindir}/docker-containerd | ||
101 | ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim | ||
102 | ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr | ||
103 | |||
104 | ln -sf containerd-ctr ${D}/${bindir}/ctr | ||
105 | |||
106 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
107 | install -d ${D}${systemd_unitdir}/system | ||
108 | install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system | ||
109 | # adjust from /usr/local/bin to /usr/bin/ | ||
110 | sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service | ||
111 | fi | ||
112 | } | ||
113 | |||
114 | FILES_${PN} += "${systemd_system_unitdir}/*" | ||
115 | |||
116 | INSANE_SKIP_${PN} += "ldflags already-stripped" | ||
117 | |||
118 | COMPATIBLE_HOST = "^(?!(qemu)?mips).*" | ||
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc deleted file mode 100644 index 2a14a44b..00000000 --- a/recipes-containers/containerd/containerd.inc +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | HOMEPAGE = "https://github.com/docker/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 | # Apache-2.0 for containerd | ||
8 | LICENSE = "Apache-2.0" | ||
9 | LIC_FILES_CHKSUM ?= "file://src/import/LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" | ||
10 | |||
11 | SRC_URI += "file://containerd.service" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | PV = "${CONTAINERD_VERSION}+git${SRCPV}" | ||
16 | |||
17 | inherit go | ||
18 | inherit goarch | ||
19 | |||
20 | GO_IMPORT = "import" | ||
21 | |||
22 | CONTAINERD_PKG="github.com/containerd/containerd" | ||
23 | |||
24 | INSANE_SKIP_${PN} += "ldflags" | ||
25 | |||
26 | do_configure[noexec] = "1" | ||
27 | |||
28 | do_compile() { | ||
29 | export GOARCH="${TARGET_GOARCH}" | ||
30 | |||
31 | # link fixups for compilation | ||
32 | rm -f ${S}/src/import/vendor/src | ||
33 | ln -sf ./ ${S}/src/import/vendor/src | ||
34 | |||
35 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/ | ||
36 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/pkg/ | ||
37 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/contrib/ | ||
38 | # without this, the stress test parts of the build fail | ||
39 | cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd | ||
40 | |||
41 | for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \ | ||
42 | protobuf reference diff platforms runtime remotes version archive dialer gc metadata \ | ||
43 | metrics filters identifiers labels leases plugin server services \ | ||
44 | cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do | ||
45 | if [ -d ${S}/src/import/${c} ]; then | ||
46 | ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c} | ||
47 | fi | ||
48 | if [ -d ${S}/src/import/pkg/${c} ]; then | ||
49 | ln -sfn ${S}/src/import/pkg/${c} ${S}/src/import/vendor/github.com/containerd/containerd/pkg/${c} | ||
50 | fi | ||
51 | if [ -d ${S}/src/import/contrib/${c} ]; then | ||
52 | ln -sfn ${S}/src/import/contrib/${c} ${S}/src/import/vendor/github.com/containerd/containerd/contrib/${c} | ||
53 | fi | ||
54 | done | ||
55 | |||
56 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
57 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
58 | |||
59 | # Pass the needed cflags/ldflags so that cgo | ||
60 | # can find the needed headers files and libraries | ||
61 | export CGO_ENABLED="1" | ||
62 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
63 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
64 | export BUILDTAGS="no_btrfs static_build netgo" | ||
65 | export CFLAGS="${CFLAGS}" | ||
66 | export LDFLAGS="${LDFLAGS}" | ||
67 | export SHIM_CGO_ENABLED="${CGO_ENABLED}" | ||
68 | |||
69 | cd ${S}/src/import | ||
70 | oe_runmake binaries | ||
71 | } | ||
72 | |||
73 | # Note: disabled for now, since docker is launching containerd | ||
74 | # inherit systemd | ||
75 | # SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
76 | # SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}" | ||
77 | |||
78 | do_install() { | ||
79 | mkdir -p ${D}/${bindir} | ||
80 | |||
81 | cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd | ||
82 | cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim | ||
83 | cp ${S}/src/import/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1 | ||
84 | cp ${S}/src/import/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2 | ||
85 | cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr | ||
86 | |||
87 | ln -sf containerd ${D}/${bindir}/docker-containerd | ||
88 | ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim | ||
89 | ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr | ||
90 | |||
91 | ln -sf containerd-ctr ${D}/${bindir}/ctr | ||
92 | |||
93 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
94 | install -d ${D}${systemd_unitdir}/system | ||
95 | install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system | ||
96 | # adjust from /usr/local/bin to /usr/bin/ | ||
97 | sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service | ||
98 | fi | ||
99 | } | ||
100 | |||
101 | FILES_${PN} += "${systemd_system_unitdir}/*" | ||
102 | |||
103 | INSANE_SKIP_${PN} += "ldflags already-stripped" | ||
104 | |||
105 | COMPATIBLE_HOST = "^(?!(qemu)?mips).*" | ||