From 195cb121a894a8e1e9e7e940c03f4c39f7703a32 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 10 Nov 2025 14:18:18 -0800 Subject: [PATCH 1/3] run_qemu.sh: pass --debug to mkosi Add v14/v15 test to adjust option based on the mkosi version. No need to change the run_qemu.sh source code anymore. Passing --debug by default is especially useful because hides the sandbox unless --debug is uses, see https://github.com/systemd/mkosi/pull/3992 Signed-off-by: Marc Herbert --- run_qemu.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/run_qemu.sh b/run_qemu.sh index 2429173..0001bf9 100755 --- a/run_qemu.sh +++ b/run_qemu.sh @@ -1443,10 +1443,14 @@ make_rootfs() setup_autorun "mkosi.extra" if [[ $_arg_debug == "on" ]]; then - # In case of yet another mkosi incompatibility or other issue, - # enable this line. WARNING: --debug options have "stability" issues - # too! Check the man page of your specific mkosi version - : # mkosi_opts+=('--debug-workspace' '--debug-shell' '--debug') + if test "$mkosi_ver" -lt 15; then + mkosi_opts+=('--debug=run') + else # See mkosi v15 commit a13e4b0e7056cc + mkosi_opts+=('--debug') + fi + # Newer options check the man page of your specific mkosi + # version, find links a the bottom of run_qemu/README.md + # mkosi_opts+=('--debug-workspace' '--debug-shell') fi mkosi_opts+=("build") From 402808fa77cd6d12bf121e6b97e81d274d241ffd Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 10 Nov 2025 14:26:41 -0800 Subject: [PATCH 2/3] .github: add --debug in the first, mkosi step too Signed-off-by: Marc Herbert --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 48387b1..19bdf1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -179,7 +179,7 @@ jobs: PATH=/usr/lib/ccache:"$PATH" \ distro=${{ matrix.cfg.img_distro }} rev=${{ matrix.cfg.img_rel }} \ ndctl='${{ github.workspace }}'/ndctl \ - ../run_qemu/run_qemu.sh ${{ matrix.run_opts }} --no-kvm --timeout=20 + ../run_qemu/run_qemu.sh ${{ matrix.run_opts }} --no-kvm --timeout=20 --debug - name: upload test logs if: ${{ !cancelled() }} From 6f71e8a6d61ea4a7bfa88371140582d0ae8e1f24 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 10 Nov 2025 14:56:58 -0800 Subject: [PATCH 3/3] run_qemu.sh: turn off set -x logs while polling every 5s Do no print 5 lines of logs every 5 seconds. Signed-off-by: Marc Herbert --- run_qemu.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run_qemu.sh b/run_qemu.sh index 0001bf9..4ed90d2 100755 --- a/run_qemu.sh +++ b/run_qemu.sh @@ -2000,14 +2000,15 @@ start_qemu() else printf "guest will be terminated after %d minute(s)\n" "$_arg_timeout" "${qcmd[@]}" & sleep 5 - timeout_sec="$(((_arg_timeout * 60) - 5))" + ( timeout_sec="$(((_arg_timeout * 60) - 5))" while ((timeout_sec > 0)); do if ! guest_alive; then break fi sleep 5 timeout_sec="$((timeout_sec - 5))" - done + set +x + done ) kill_guest fi popd > /dev/null || exit 1