mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-01 19:36:04 +08:00
Provisioning: linux - install virtual video test driver vivid
The vivid kernel module emulates a v4l2 video devices like webcams. We instantiate two devices via vivid to allow qt multimedia unit tests requiring multiple cameras to run correctly. Pick-to: 6.5 6.7 6.8 Change-Id: I1b87954e3c8af797f5b09dabf2d4939d8320db06 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
This commit is contained in:
56
coin/provisioning/common/linux/install-vivid-camera.sh
Executable file
56
coin/provisioning/common/linux/install-vivid-camera.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2024 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
set -ex
|
||||
|
||||
systemd_folder=/etc/systemd/system
|
||||
systemd_file=vivid.service
|
||||
script_folder=/home/qt/bin
|
||||
script_file=vivid.sh
|
||||
|
||||
# Ensure that script folder exists
|
||||
if [ ! -d ${script_folder} ]; then
|
||||
sudo mkdir ${script_folder}
|
||||
sudo chmod 750 ${script_folder}
|
||||
fi
|
||||
|
||||
# Create script to install virtual video test driver module
|
||||
sudo tee "${script_folder}/${script_file}" <<"EOF"
|
||||
# load vivid
|
||||
sudo modprobe vivid n_devs=2 # create two video devices
|
||||
|
||||
# Check result
|
||||
if lsmod | grep -q vivid
|
||||
then
|
||||
echo "(**) Virtual video test driver vivid installed.";
|
||||
else
|
||||
echo "(EE) Failed to load vivid 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/vivid.service
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Install virtual video test driver (vivid)
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c "/home/qt/bin/vivid.sh"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Start service and output result, just for logging
|
||||
sudo systemctl start vivid.service
|
||||
|
||||
# enable service
|
||||
sudo systemctl enable vivid.service
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2024 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
set -ex
|
||||
|
||||
# shellcheck source=../common/linux/install-vivid-camera.sh
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-vivid-camera.sh"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2024 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
set -ex
|
||||
|
||||
# shellcheck source=../common/linux/install-vivid-camera.sh
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-vivid-camera.sh"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2024 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
set -ex
|
||||
|
||||
# shellcheck source=../common/linux/install-vivid-camera.sh
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-vivid-camera.sh"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2024 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
set -ex
|
||||
|
||||
# shellcheck source=../common/linux/install-vivid-camera.sh
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-vivid-camera.sh"
|
||||
Reference in New Issue
Block a user