selftests/bpf: workaround stdout issue in VM launched by vmtest.sh
Subsystems (3)
PATCH 1/1 selftests/bpf: workaround stdout issue in VM launched by vmtest.sh
This apply a workaround to fix stdout issue in ./vmtest.sh invocations, but doesn't work on ./vmtest.sh -s
--- tools/testing/selftests/bpf/vmtest.sh | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/bpf/vmtest.sh +4 -0
@@ -184,6 +184,10 @@ EOF fi sudo bash -c "echo '#!/bin/bash' > ${init_script}" + sudo bash -c "cat >>${init_script}" <<EOF +# Force rebinding stdout/stderr to /dev/ttyS0, to workaround a mysterious issue +exec 1>/dev/ttyS0 2>/dev/ttyS0 +EOF if [[ "${command}" != "" ]]; then sudo bash -c "cat >>${init_script}" <<EOF
Signature · 1 line
2.30.2
Song Liu
reviewerQuoted 5 lines · Yucong Sun
This apply a workaround to fix stdout issue in
./vmtest.shinvocations, but doesn't work on./vmtest.sh -sSigned-off-by Yucong Sun <[email protected]>
Could you please provide more information about the issue?
Quoted 22 lines
--- tools/testing/selftests/bpf/vmtest.sh | 4 ++++ 1 file changed, 4 insertions(+)tools/testing/selftests/bpf/vmtest.sh +4
-1@@ -184,6 +184,10 @@ EOF fi sudo bash -c "echo '#!/bin/bash' > ${init_script}" + sudo bash -c "cat >>${init_script}" <<EOF +# Force rebinding stdout/stderr to /dev/ttyS0, to workaround a mysterious issue +exec 1>/dev/ttyS0 2>/dev/ttyS0 +EOF if [[ "${command}" != "" ]]; then sudo bash -c "cat >>${init_script}" <<EOF --2.30.2
Quoted 1 line
Could you please provide more information about the issue?
Still trying to get to the root cause of this issue, I've found that
after https://github.com/kernel-patches/bpf/commit/cb80ddc67152e72f28ff6ea8517acdf875d7381d
, the init process would lose stdout on startup .
ls -lah /proc/1/fd/0 /proc/1/fd/1 /proc/1/fd/2 /proc/1/fd/6 /proc/1/fd/7 lrwx------1 root root 64 Feb 23 17:20 /proc/1/fd/0 -> /dev/null lrwx------ 1 root root 64 Feb 23 17:20 /proc/1/fd/1 -> /dev/null lrwx------ 1 root root 64 Feb 23 17:20 /proc/1/fd/2 -> /dev/console lrwx------ 1 root root 64 Feb 23 17:20 /proc/1/fd/6 -> /dev/console lrwx------ 1 root root 64 Feb 23 17:20 /proc/1/fd/7 -> /dev/console
and same command on the good commit
ls -lah /proc/1/fd/0 /proc/1/fd/1 /proc/1/fd/2 lrwx------ 1 root root 64 Feb 23 17:23 /proc/1/fd/0 -> /dev/console lrwx------ 1 root root 64 Feb 23 17:23 /proc/1/fd/1 -> /dev/console lrwx------ 1 root root 64 Feb 23 17:23 /proc/1/fd/2 -> /dev/console
This patch is merely a workaround until we find and fix the real issue.
Cheers.