[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 6/7] docker: More sensible run script
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v5 6/7] docker: More sensible run script |
Date: |
Tue, 12 Jul 2016 16:00:38 +0100 |
From: Fam Zheng <address@hidden>
It is very easy to figure out current directory and bash option from the
execution, so do less in the Makefile invocation command line, and
figure both options in the script.
This makes the next patch easier.
Signed-off-by: Fam Zheng <address@hidden>
---
tests/docker/Makefile.include | 4 +---
tests/docker/run | 12 +++++++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index f88c0a7..c5546ee 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -114,10 +114,8 @@ docker-run-%: docker-qemu-src
-e CCACHE_DIR=/var/tmp/ccache \
-v $$(realpath
$(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
- -w /var/tmp/qemu \
qemu:$(IMAGE) \
- $(if $V,/bin/bash -x ,) \
- ./run \
+ /var/tmp/qemu/run \
$(CMD); \
, " RUN $(CMD) in $(IMAGE)")))
diff --git a/tests/docker/run b/tests/docker/run
index ec3d119..575e732 100755
--- a/tests/docker/run
+++ b/tests/docker/run
@@ -11,6 +11,12 @@
# or (at your option) any later version. See the COPYING file in
# the top-level directory.
+if test -n "$V"; then
+ set -x
+fi
+
+BASE="$(dirname $(realpath $0))"
+
# Prepare the environment
. /etc/profile || true
export PATH=/usr/lib/ccache:$PATH
@@ -24,10 +30,10 @@ export TEST_DIR=/tmp/qemu-test
mkdir -p $TEST_DIR/{src,build,install}
# Extract the source tarballs
-tar -C $TEST_DIR/src -xzf qemu.tgz
+tar -C $TEST_DIR/src -xzf $BASE/qemu.tgz
for p in dtc pixman; do
- if test -f $p.tgz; then
- tar -C $TEST_DIR/src/$p -xzf $p.tgz
+ if test -f $BASE/$p.tgz; then
+ tar -C $TEST_DIR/src/$p -xzf $BASE/$p.tgz
export FEATURES="$FEATURES $p"
fi
done
--
2.7.4
- [Qemu-devel] [PATCH v5 0/7] docker: Support building qemu-user powered docker test images, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 3/7] tests/docker/docker.py: check and run .pre script, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 2/7] tests/docker/docker.py: support --include-executable, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 5/7] tests/docker/docker.py: add update operation, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 1/7] tests/docker/docker.py: docker_dir outside build, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 6/7] docker: More sensible run script,
Alex Bennée <=
- [Qemu-devel] [PATCH v5 4/7] tests/docker/dockerfiles: new debian-bootstrap.docker, Alex Bennée, 2016/07/12
- [Qemu-devel] [PATCH v5 7/7] docker: Fix exit code if $CMD failed, Alex Bennée, 2016/07/12
- Re: [Qemu-devel] [PATCH v5 0/7] docker: Support building qemu-user powered docker test images, Alex Bennée, 2016/07/18