diff mbox series

[RFC,07/10] docker: fall-back to binfmt_misc debian-s390x-user-cross on non-x86

Message ID 20180718100505.7546-8-alex.bennee@linaro.org
State New
Headers show
Series docker on non-x86 hosts | expand

Commit Message

Alex Bennée July 18, 2018, 10:05 a.m. UTC
The Debian archives don't package their large array of cross compilers
for all host architectures. For s390x let's fall back to a linux-user
based image when we can't use the native ones.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/docker/Makefile.include                    |  9 ++++++++-
 .../dockerfiles/debian-s390x-user-cross.docker   | 16 ++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 tests/docker/dockerfiles/debian-s390x-user-cross.docker

-- 
2.17.1
diff mbox series

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 879bacde93..e1eba21f06 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -169,8 +169,15 @@  docker-image-debian-ppc64el-user-cross: docker-binfmt-image-debian-ppc64el-user
 DOCKER_USER_IMAGES += debian-ppc64el-user-cross
 DOCKER_PARTIAL_IMAGES += debian-ppc64el-cross
 
+# No s390x cross-compilers in non-x86 Debian images, so use linux-user
+docker-binfmt-image-debian-s390x-user: DEB_ARCH = s390x
+docker-binfmt-image-debian-s390x-user: DEB_TYPE = stretch
+docker-binfmt-image-debian-s390x-user: EXECUTABLE = ${BUILD_DIR}/s390x-linux-user/qemu-s390x
+docker-image-debian-s390x-user-cross: docker-binfmt-image-debian-s390x-user
+DOCKER_USER_IMAGES += debian-s390x-user-cross
+DOCKER_PARTIAL_IMAGES += debian-s390x-cross
 else
-DOCKER_PARTIAL_IMAGES += debian-mips64el-user-cross debian-ppc64el-user-cross
+DOCKER_PARTIAL_IMAGES += debian-mips64el-user-cross debian-ppc64el-user-cross debian-s390x-user-cross
 endif
 
 
diff --git a/tests/docker/dockerfiles/debian-s390x-user-cross.docker b/tests/docker/dockerfiles/debian-s390x-user-cross.docker
new file mode 100644
index 0000000000..396763f10e
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-s390x-user-cross.docker
@@ -0,0 +1,16 @@ 
+#
+# Docker s390x user cross-compiler target
+#
+# This is a binfmt image for when the s390x cross compilers are not
+# available in the host architecture archives. This image is based of
+# the debootstrapped qemu:debian-s390x-user but doesn't need any
+# extra magic once it is setup.
+#
+
+FROM qemu:debian-s390x-user
+
+MAINTAINER Alex Bennee <alex.bennee@linaro.org>
+
+RUN echo man-db man-db/auto-update boolean false | debconf-set-selections
+RUN apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt-get build-dep -yy qemu