diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2024-01-15 12:25:02 +0100 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2024-01-16 13:01:08 +0100 |
commit | b93bcc2c9c2880461a9aab8384c61f5ddcfa30d6 (patch) | |
tree | 6ee511620011897f2bce7c7994da13577f101057 | |
parent | 96e4ffd6d9ce4bb837428a27ed7615821580ed14 (diff) |
COIN: Install a systemd script for starting a dummy sound device
Don't load the dummy sound module directly.
Install a systemd script instead.
This amends 198cd69244618813ebc048c51c120b699620a863.
Fixes: QTBUG-120655
Pick-to: 6.7 6.6 6.5
Change-Id: If727a60d1cf3683615775ae55efe9bae159d147e
Reviewed-by: Toni Saario <toni.saario@qt.io>
-rwxr-xr-x | coin/provisioning/qtci-linux-openSUSE-15.5-x86_64/91-install-dummy-sound.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/coin/provisioning/qtci-linux-openSUSE-15.5-x86_64/91-install-dummy-sound.sh b/coin/provisioning/qtci-linux-openSUSE-15.5-x86_64/91-install-dummy-sound.sh index ad5199b9..345c5efa 100755 --- a/coin/provisioning/qtci-linux-openSUSE-15.5-x86_64/91-install-dummy-sound.sh +++ b/coin/provisioning/qtci-linux-openSUSE-15.5-x86_64/91-install-dummy-sound.sh @@ -4,6 +4,21 @@ set -ex +systemd_folder=/etc/systemd/system +systemd_file=dummysound.service +script_folder=/home/qt/bin +script_file=dummy_sound.sh + +# Create script to install dummy sound driver, +# in case no other sound driver is installed. +sudo tee "${script_folder}/${script_file}" <<"EOF" +# Check for existing sound driver +if lsmod | grep -q -i snd +then + echo "(**) Sound driver already loaded. Nothing to do."; + exit 0; +fi + # load dummy sound module sudo modprobe snd-dummy @@ -15,3 +30,31 @@ else echo "(EE) Failed to load dummy sound driver."; exit 1; fi +EOF + +# set permissions +sudo chmod 750 "${script_folder}/${script_file}" + +# Create service file +sudo tee "${systemd_folder}/${systemd_file}" <<"EOF" +# /etc/systemd/system/dummysound.service +# + +[Unit] +Description=Install dummy sound driver + +[Service] +Type=oneshot +ExecStart=/bin/sh -c "/home/qt/bin/dummy_sound.sh" + +[Install] +WantedBy=multi-user.target +EOF + +# Start servive and output result, just for logging +sudo systemctl start dummysound.service +# status commented out, returns 3 on VM. +# sudo systemctl status dummysound.service + +# enable service +sudo systemctl enable dummysound.service |