Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion case-lib/lib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# get test-case information
SCRIPT_HOME="$(dirname "$0")"
SCRIPT_HOME="$(dirname "${BASH_SOURCE[0]}")"
# get test-case parent folder name
SCRIPT_HOME=$(cd "$SCRIPT_HOME/.." && pwd)
# shellcheck disable=SC2034 # external script can use it
Expand Down Expand Up @@ -162,6 +162,42 @@ func_lib_check_sudo()
}
}

systemctl_show_pulseaudio()
{
printf '\n'
local domain
for domain in --system --global --user; do
( set -x
systemctl "$domain" list-unit-files --all '*pulse*'
) || true
printf '\n'
done

printf 'For %s ONLY:\n' "$(id -un)"
( set -x
systemctl --user list-units --all '*pulse*'
) || true
printf '\n'

# pgrep ouput is nicer because it hides itself, however pgrep does
# not show a critical information: the userID which can be not us
# but 'gdm'!
# shellcheck disable=SC2009
ps axu | grep -i pulse
>&2 printf 'ERROR: %s fails semi-randomly when pulseaudio is running\n' \
"$(basename "$0")"

>&2 printf '\nTry: sudo systemctl --global mask pulseaudio.{socket,service} and reboot.
--global is required for session managers like "gdm"
'
# We cannot suggest "systemctl --user mask" for a 'gdm' user
# because we can't 'su' to it and access its DBUS, so we suggest
# --global to keep it simple. If --global is too strong for you, you
# can manually create a
# /var/lib/gdm3/.config/systemd/user/pulseaudio.service -> /dev/null
# symlink
}

declare -a PULSECMD_LST
declare -a PULSE_PATHS

Expand Down
10 changes: 7 additions & 3 deletions tools/kmod/sof_remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation. All rights reserved.


TOPDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)

# shellcheck source=case-lib/lib.sh
source "$TOPDIR"/case-lib/lib.sh

remove_module() {

local MODULE="$1"
Expand All @@ -22,9 +28,7 @@ exit_handler()
# warn about any running pulseaudio because it could make us fail
# the next time.
if pgrep -a pulseaudio; then
>&2 printf 'ERROR: %s fails semi-randomly when pulseaudio is running\n' \
"$(basename "$0")"
systemctl --user list-units --all '*pulse*' || true
systemctl_show_pulseaudio
fi

if test "$exit_status" -ne 0; then
Expand Down