[meta-virtualization] [PATCH] docker: add docker-app support
liu.ming50 at gmail.com
liu.ming50 at gmail.com
Tue Aug 20 01:54:12 PDT 2019
From: Ming Liu <liu.ming50 at gmail.com>
A docker-cpp binary would be generated after this change.
Signed-off-by: Ming Liu <liu.ming50 at gmail.com>
---
recipes-containers/docker/docker_git.bb | 9 +++++++
.../0001-Makefile-do-not-override-LDFLAGS.patch | 31 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 recipes-containers/docker/files/0001-Makefile-do-not-override-LDFLAGS.patch
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index e45f87e..bf9cdc7 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -38,13 +38,16 @@ DESCRIPTION = "Linux container runtime \
SRCREV_moby = "344b093258fcb2195fa393081e5224a6c766c798"
SRCREV_libnetwork = "5ac07abef4eee176423fdc1b870d435258e2d381"
SRCREV_cli = "2f1931f9eb2d6bac2efd48d94739f2e9919d4d7d"
+SRCREV_app = "ad4481ea1a063659f15cac38048883b54f0820e2"
SRC_URI = "\
git://github.com/moby/moby.git;nobranch=1;name=moby \
git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \
git://github.com/docker/cli;branch=19.03;name=cli;destsuffix=git/cli \
+ git://github.com/docker/app;branch=master;name=app;destsuffix=git/app \
file://docker.init \
file://0001-libnetwork-use-GO-instead-of-go.patch \
file://0001-imporve-hardcoded-CC-on-cross-compile.patch \
+ file://0001-Makefile-do-not-override-LDFLAGS.patch \
"
require docker.inc
@@ -83,6 +86,7 @@ do_compile() {
mkdir -p .gopath/src/github.com/docker
ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork
ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli
+ ln -sf ${WORKDIR}/git/app .gopath/src/github.com/docker/app
export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
@@ -111,6 +115,10 @@ do_compile() {
export DOCKER_VERSION=${DOCKER_VERSION}
VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
+ # build the app
+ cd ${S}/src/import/.gopath/src/github.com/docker/app
+ make dynamic
+
# build the proxy
cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork
oe_runmake cross-local
@@ -119,6 +127,7 @@ do_compile() {
do_install() {
mkdir -p ${D}/${bindir}
cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
+ cp ${WORKDIR}/git/app/bin/docker-app ${D}/${bindir}/docker-app
cp ${S}/src/import/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy
diff --git a/recipes-containers/docker/files/0001-Makefile-do-not-override-LDFLAGS.patch b/recipes-containers/docker/files/0001-Makefile-do-not-override-LDFLAGS.patch
new file mode 100644
index 0000000..c987a51
--- /dev/null
+++ b/recipes-containers/docker/files/0001-Makefile-do-not-override-LDFLAGS.patch
@@ -0,0 +1,31 @@
+From 494b5f6982a35e285d3ef15e67d2fe27873909e4 Mon Sep 17 00:00:00 2001
+From: Ming Liu <liu.ming50 at gmail.com>
+Date: Sun, 18 Aug 2019 11:52:14 +0800
+Subject: [PATCH] Makefile: do not override LDFLAGS
+
+Replace a ":=" by "+=" when setting LDFLAGS, this ensures it would not
+override the linking flags from OE environment.
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: Ming Liu <liu.ming50 at gmail.com>
+---
+ app/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/app/Makefile b/app/Makefile
+index 77f18b4..d311726 100644
+--- a/app/Makefile
++++ b/app/Makefile
+@@ -13,7 +13,7 @@ ifeq ($(EXPERIMENTAL),on)
+ BUILDTAGS="experimental"
+ endif
+
+-LDFLAGS := "-s -w \
++LDFLAGS := " \
+ -X $(PKG_NAME)/internal.GitCommit=$(COMMIT) \
+ -X $(PKG_NAME)/internal.Version=$(TAG) \
+ -X $(PKG_NAME)/internal.Experimental=$(EXPERIMENTAL) \
+--
+2.7.4
+
--
2.7.4
More information about the meta-virtualization
mailing list