Skip to content

Commit

Permalink
lib.sh: workaround "sudo ... &" corruption issue 1151 for stable-v2.2
Browse files Browse the repository at this point in the history
Should finally fix terminal corruption issue #1151.

Commit 8341638 was a good workaround but it was applied only for
Zephyr's mtrace.

- Apply the same workaround for stable-v2.2 sof-logger
- Explain better in the source what causes the corruption
- Change owner of mtrace.txt logs to "ubuntu" instead of root.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Jul 12, 2024
1 parent 9834162 commit ae8bfef
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,13 @@ func_mtrace_collect()

local mtraceCmd=("$MTRACE")
dlogi "Starting ${mtraceCmd[*]} >& $clogfile &"

# Cleaned up by func_exit_handler() in hijack.sh
# The use of 'bash -c' is a workaround for below issue:
# https://github.com/thesofproject/sof-test/issues/1151
#
# We need "bash -c" because "sudo ... &" corrupts the terminal among
# other issues, see bug #1151.
# shellcheck disable=SC2024
sudo bash -c "${mtraceCmd[*]} >& $clogfile &"
sudo bash -c "${mtraceCmd[*]} &" >& "$clogfile"
}

func_lib_log_post_process()
Expand Down Expand Up @@ -461,9 +463,13 @@ func_sof_logger_collect()
# shellcheck disable=SC2206
local loggerCmd=("$SOFLOGGER" $logopt -l "$ldcFile")
dlogi "Starting ${loggerCmd[*]} > $logfile &"

# Cleaned up by func_exit_handler() in hijack.sh
#
# We need "bash -c" because "sudo ... &" corrupts the terminal among
# other issues, see bug #1151.
# shellcheck disable=SC2024
sudo "${loggerCmd[@]}" > "$logfile" &
sudo bash -c "${loggerCmd[*]} &" > "$logfile"
}

SOF_LOG_COLLECT=0
Expand Down

0 comments on commit ae8bfef

Please sign in to comment.