Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash

From: Joe Lawrence

Date: Mon Feb 23 2026 - 10:48:51 EST


On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza wrote:
> When running current selftests on older distributions like SLE12-SP5 that
> contains an older bash trips over heredoc. Convert it to plain echo
> calls, which ends up with the same result.
>

Acked-by: Joe Lawrence <joe.lawrence@xxxxxxxxxx>

Just curious, what's the bash/heredoc issue? All I could find via
google search was perhaps something to do with the temporary file
implementation under the hood.

--
Joe

> Signed-off-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
> ---
> tools/testing/selftests/livepatch/functions.sh | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> index 8ec0cb64ad94..45ed04c6296e 100644
> --- a/tools/testing/selftests/livepatch/functions.sh
> +++ b/tools/testing/selftests/livepatch/functions.sh
> @@ -96,10 +96,8 @@ function pop_config() {
> }
>
> function set_dynamic_debug() {
> - cat <<-EOF > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> - file kernel/livepatch/* +p
> - func klp_try_switch_task -p
> - EOF
> + echo "file kernel/livepatch/* +p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> + echo "func klp_try_switch_task -p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> }
>
> function set_ftrace_enabled() {
>
> --
> 2.52.0
>