summaryrefslogtreecommitdiff
path: root/tests/create-and-run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/create-and-run.sh')
-rwxr-xr-xtests/create-and-run.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/create-and-run.sh b/tests/create-and-run.sh
index 26fe4f7..1f164b9 100755
--- a/tests/create-and-run.sh
+++ b/tests/create-and-run.sh
@@ -21,7 +21,7 @@ trap cleanup EXIT INT TERM QUIT
ssh-keygen -f "$SSH_KEYPATH" -N ''
MIRROR=
-if ! curl -s "http://deb.debian.org/debian/dists/$RELEASE/InRelease" | sed -n 's/^Architectures: //p' | grep -qw "$ARCHITECTURE"; then
+if test -n "$RELEASE" && ! curl -s "http://deb.debian.org/debian/dists/$RELEASE/InRelease" | sed -n 's/^Architectures: //p' | grep -qw "$ARCHITECTURE"; then
MIRROR="deb [signed-by=/usr/share/keyrings/debian-ports-archive-keyring.gpg] http://deb.debian.org/debian-ports $RELEASE main"
fi
if test "$ARCHITECTURE" = armel; then
@@ -33,9 +33,23 @@ case "$RELEASE" in
MIRROR=http://archive.debian.org/debian
;;
esac
-set -- --architectures="$ARCHITECTURE"
-test -n "$MIRROR" && set -- "$@" "$MIRROR"
-debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" -- "$@"
+set -- -- --architectures="$ARCHITECTURE"
+if test -z "$RELEASE"; then
+ # The ordering of maybe-merged-usr and
+ # copy-host-apt-sources-and-preferences is unfortunately the wrong way
+ # round. Therefore, we make debvm-create skip it and pass it ourselves.
+ # The final empty string is the mirror specification.
+ set -- \
+ --skip=usrmerge \
+ "$@" \
+ --hook-dir=/usr/share/mmdebstrap/hooks/copy-host-apt-sources-and-preferences \
+ --hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount \
+ --hook-dir=/usr/share/mmdebstrap/hooks/maybe-merged-usr \
+ ""
+elif test -n "$MIRROR"; then
+ set -- "$@" "$MIRROR"
+fi
+debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" "$@"
SSH_PORT=2222
timeout 300s debvm-run -s "$SSH_PORT" -i "$IMAGE" &