diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 599bdde..98328d0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -25,6 +25,7 @@ "reveal": "always", "focus": false, "panel": "shared", + "group": "test", "showReuseMessage": true, "clear": false }, @@ -33,13 +34,14 @@ { "label": "dbg", "type": "shell", - "command": "sleep 1;${workspaceRoot}/dbg", + "command": "${workspaceRoot}/dbg", "group": "none", "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared", + "group": "test", "showReuseMessage": true, "clear": false } diff --git a/dbg b/dbg index 5b14088..22a94aa 100755 --- a/dbg +++ b/dbg @@ -14,4 +14,5 @@ fi docker-compose -f toolchain/docker-compose.yml run \ --rm \ + -e WAITHOST=emul \ run ${cmd} \ No newline at end of file diff --git a/toolchain/Dockerfile.run b/toolchain/Dockerfile.run index 5bf0113..337f643 100644 --- a/toolchain/Dockerfile.run +++ b/toolchain/Dockerfile.run @@ -4,7 +4,8 @@ RUN apt-get update && \ apt-get install -y \ qemu-system-x86 \ gdb \ - novnc + novnc \ + netcat ENV MITTOS64 "true" ENV BUILDROOT "/opt" diff --git a/toolchain/run-entrypoint.sh b/toolchain/run-entrypoint.sh index 78f37a7..2d5741b 100755 --- a/toolchain/run-entrypoint.sh +++ b/toolchain/run-entrypoint.sh @@ -4,4 +4,11 @@ if [[ -n "$WEBSOCK" ]]; then websockify --web /usr/share/novnc 6080 localhost:5900 & fi +if [[ -n "$WAITHOST" ]]; then + until nc -z "${WAITHOST}" "${WAITPORT:-1234}" >/dev/null 2>&1; do + >&2 echo "Waiting for ${WAITHOST} ${WAITPORT:-1234}" + sleep 1 + done +fi + eval "$@" \ No newline at end of file