[meta-virtualization] [PATCH 6/7] docker: fix paths for cross compile
Amy Fong
amy.fong at windriver.com
Tue Oct 6 11:41:14 PDT 2015
Some of the cgo variables were pointing to host paths and not target
Fix install rules - binaries can be installed to a subdirectory.
Signed-off-by: Amy Fong <amy.fong at windriver.com>
---
recipes-containers/docker/docker_git.bb | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index 165b319..0127baf 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -83,10 +83,12 @@ do_compile() {
export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
cd -
+ export CGO_ENABLED="1"
+
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
- export CGO_CFLAGS="${BUILD_CFLAGS}"
- export CGO_LDFLAGS="${BUILD_LDFLAGS}"
+ export CGO_CFLAGS="${BUILDSDK_CFLAGS}"
+ export CGO_LDFLAGS="${BUILDSDK_LDFLAGS}"
# this is the unsupported built structure
# that doesn't rely on an existing docker
@@ -124,7 +126,11 @@ do_install() {
install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
fi
- cp ${S}/vendor/bin/nsinit ${D}/${bindir}
+ if [ -d ${S}/vendor/bin/linux_* ]; then
+ cp ${S}/vendor/bin/linux_*/* ${D}/${bindir}
+ else
+ cp ${S}/vendor/bin/* ${D}/${bindir}
+ fi
mkdir -p ${D}/usr/share/docker/
cp ${WORKDIR}/hi.Dockerfile ${D}/usr/share/docker/
--
2.5.3
More information about the meta-virtualization
mailing list