mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 20:59:41 +02:00
containerd: fix final TMDIR references
restructure the containerd source layout to avoid symlinking vendor dependencies. This avoid go recording paths in the final binaries. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
parent
c278a05948
commit
a61f6ea090
|
@ -19,10 +19,10 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|||
Makefile | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git git.orig/src/import/Makefile git.orig/src/import/Makefile
|
||||
diff --git git.orig/Makefile git.orig/Makefile
|
||||
index c61418e60..54a10eb42 100644
|
||||
--- git.orig/src/import/Makefile
|
||||
+++ git.orig/src/import/Makefile
|
||||
--- git.orig/Makefile
|
||||
+++ git.orig/Makefile
|
||||
@@ -112,7 +112,8 @@ endif
|
||||
GOPATHS=$(shell echo ${GOPATH} | tr ":" "\n" | tr ";" "\n")
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|||
Makefile | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git git.orig/src/import/Makefile git.orig/src/import/Makefile
|
||||
diff --git git.orig/Makefile git.orig/Makefile
|
||||
index 4a6c13042..debb57925 100644
|
||||
--- git.orig/src/import/Makefile
|
||||
+++ git.orig/src/import/Makefile
|
||||
--- git.orig/Makefile
|
||||
+++ git.orig/Makefile
|
||||
@@ -130,7 +130,6 @@ TESTFLAGS_RACE=
|
||||
# See Golang issue re: '-trimpath': https://github.com/golang/go/issues/13809
|
||||
GO_GCFLAGS=$(shell \
|
||||
|
|
|
@ -6,14 +6,14 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and
|
|||
|
||||
|
||||
SRCREV = "579a6380ec93ab92a6e7f26167fe4f18dfcf2a4b"
|
||||
SRC_URI = "git://github.com/containerd/containerd;branch=release/1.6;protocol=https \
|
||||
SRC_URI = "git://github.com/containerd/containerd;branch=release/1.6;protocol=https;destsuffix=git/src/github.com/containerd/containerd \
|
||||
file://0001-Makefile-allow-GO_BUILD_FLAGS-to-be-externally-speci.patch \
|
||||
file://0001-build-don-t-use-gcflags-to-define-trimpath.patch \
|
||||
"
|
||||
|
||||
# Apache-2.0 for containerd
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=1269f40c0d099c21a871163984590d89"
|
||||
|
||||
CONTAINERD_VERSION = "v1.6.8"
|
||||
CVE_VERSION = "1.6.8"
|
||||
|
@ -23,7 +23,7 @@ CVE_VERSION = "1.6.8"
|
|||
PROVIDES += "virtual/containerd"
|
||||
RPROVIDES:${PN} = "virtual-containerd"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
S = "${WORKDIR}/git/src/github.com/containerd/containerd"
|
||||
|
||||
PV = "${CONTAINERD_VERSION}+git${SRCPV}"
|
||||
|
||||
|
@ -41,34 +41,7 @@ do_configure[noexec] = "1"
|
|||
do_compile() {
|
||||
export GOARCH="${TARGET_GOARCH}"
|
||||
|
||||
# link fixups for compilation
|
||||
rm -f ${S}/src/import/vendor/src
|
||||
ln -sf ./ ${S}/src/import/vendor/src
|
||||
|
||||
mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/
|
||||
mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/pkg/
|
||||
mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/contrib/
|
||||
# without this, the stress test parts of the build fail
|
||||
cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd
|
||||
|
||||
for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \
|
||||
protobuf reference diff platforms runtime remotes version archive dialer gc metadata \
|
||||
metrics filters identifiers labels leases plugin server services \
|
||||
cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp \
|
||||
cap cri userns atomic ioutil os registrar seutil runtimeoptions netns \
|
||||
shutdown schedcore tracing kmutex; do
|
||||
if [ -d ${S}/src/import/${c} ]; then
|
||||
ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c}
|
||||
fi
|
||||
if [ -d ${S}/src/import/pkg/${c} ]; then
|
||||
ln -sfn ${S}/src/import/pkg/${c} ${S}/src/import/vendor/github.com/containerd/containerd/pkg/${c}
|
||||
fi
|
||||
if [ -d ${S}/src/import/contrib/${c} ]; then
|
||||
ln -sfn ${S}/src/import/contrib/${c} ${S}/src/import/vendor/github.com/containerd/containerd/contrib/${c}
|
||||
fi
|
||||
done
|
||||
|
||||
export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
|
||||
export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go:${WORKDIR}/git/"
|
||||
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
|
||||
|
||||
# Pass the needed cflags/ldflags so that cgo
|
||||
|
@ -87,7 +60,8 @@ do_compile() {
|
|||
export GO_BUILD_FLAGS="-trimpath -a -pkgdir dontusecurrentpkgs"
|
||||
export GO111MODULE=off
|
||||
|
||||
cd ${S}/src/import
|
||||
cd ${S}
|
||||
|
||||
oe_runmake binaries
|
||||
}
|
||||
|
||||
|
@ -98,11 +72,11 @@ SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','conta
|
|||
do_install() {
|
||||
mkdir -p ${D}/${bindir}
|
||||
|
||||
cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd
|
||||
cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim
|
||||
cp ${S}/src/import/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1
|
||||
cp ${S}/src/import/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2
|
||||
cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr
|
||||
cp ${S}/bin/containerd ${D}/${bindir}/containerd
|
||||
cp ${S}/bin/containerd-shim ${D}/${bindir}/containerd-shim
|
||||
cp ${S}/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1
|
||||
cp ${S}/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2
|
||||
cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr
|
||||
|
||||
ln -sf containerd ${D}/${bindir}/docker-containerd
|
||||
ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
|
||||
|
@ -112,7 +86,7 @@ do_install() {
|
|||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 644 ${S}/src/import/containerd.service ${D}/${systemd_unitdir}/system
|
||||
install -m 644 ${S}/containerd.service ${D}/${systemd_unitdir}/system
|
||||
# adjust from /usr/local/bin to /usr/bin/
|
||||
sed -e "s:/usr/local/bin/containerd:${bindir}/containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service
|
||||
fi
|
||||
|
|
|
@ -12,10 +12,10 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|||
Makefile | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: git/src/import/Makefile
|
||||
Index: git/Makefile
|
||||
===================================================================
|
||||
--- git.orig/src/import/Makefile
|
||||
+++ git/src/import/Makefile
|
||||
--- git.orig/Makefile
|
||||
+++ git/Makefile
|
||||
@@ -121,7 +121,7 @@
|
||||
TESTFLAGS_PARALLEL ?= 8
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user