diff mbox

[v2,19/21] docker: add special rule for deboostrapped images

Message ID 20180629205232.27190-20-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Bennée June 29, 2018, 8:52 p.m. UTC
We might as well have a custom rule for this. For one things the
dependencies are different. We drop the test and EXECUTABLE lines from
the general rule as they are no longer needed there.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/Makefile.include | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 8641f5da2c..d3bd2f57dd 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -49,16 +49,32 @@  docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 		"CHECK", "$*")
 else
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
-	@if test "$@" = docker-image-debian-bootstrap -a -z "$(EXECUTABLE)"; then \
-		echo WARNING: EXECUTABLE is not set, debootstrap may fail. 2>&1 ; \
-	fi
 	$(call quiet-command,\
 		$(DOCKER_SCRIPT) build qemu:$* $< \
 		$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
 		$(if $(NOUSER),,--add-current-user) \
-		$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
-		$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\
+		$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES)),\
 		"BUILD","$*")
+
+# special rule for debootstrapped debian-FOO-user images
+docker-image-debian-%-user: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
+	@if test -z "$(EXECUTABLE)"; then \
+		echo WARNING: EXECUTABLE is not set, debootstrap may fail. 2>&1 ; \
+	fi
+	@if test -z "$(DEB_ARCH)"; then 					\
+		echo WARNING: DEB_ARCH is not set, debootstrap may fail. 2>&1 ; \
+        fi
+	@if test -z "$(DEB_TYPE)"; then 					\
+		echo WARNING: DEB_TYPE is not set, debootstrap may fail. 2>&1 ; \
+        fi
+	$(call quiet-command,							\
+		$(DOCKER_SCRIPT) build qemu:debian-$*-user $< \
+		$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
+		$(if $(NOUSER),,--add-current-user) \
+		$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
+		$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)) \
+		-E DEB_ARCH=${DEB_ARCH} -E DEB_TYPE=${DEB_TYPE}, \
+		"BUILD","debian-$*-user (debootstrapped linux-user)")
 endif
 
 # Enforce dependencies for composite images