docker: Support showing environment information

Add a make variable SHOW_ENV. When it's set to non empty, print the
package information and environment variables.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1474429768-25027-8-git-send-email-famz@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Fam Zheng 2016-09-21 11:49:26 +08:00
parent 9445c28ec3
commit ec960b9a73
2 changed files with 12 additions and 1 deletions

View File

@ -117,7 +117,7 @@ docker-run-%: docker-qemu-src
$(if $(DEBUG),-i,--net=none) \
-e TARGET_LIST=$(TARGET_LIST) \
-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
-e V=$V -e J=$J -e DEBUG=$(DEBUG)\
-e V=$V -e J=$J -e DEBUG=$(DEBUG) -e SHOW_ENV=$(SHOW_ENV)\
-e CCACHE_DIR=/var/tmp/ccache \
-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \

View File

@ -40,6 +40,17 @@ for p in dtc pixman; do
fi
done
if test -n "$SHOW_ENV"; then
if test -f /packages.txt; then
echo "Packages installed:"
cat /packages.txt
echo
fi
echo "Environment variables:"
env
echo
fi
export QEMU_SRC="$TEST_DIR/src"
cd "$QEMU_SRC/tests/docker"