mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
![Gautam Menghani](/assets/img/avatar_default.png)
Improve the readability of error message which says module not found. The new behaviour is consistent with the modprobe command. Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
25 lines
552 B
Bash
Executable file
25 lines
552 B
Bash
Executable file
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Kselftest framework requirement - SKIP code is 4.
|
|
ksft_skip=4
|
|
|
|
if [ $UID != 0 ]; then
|
|
echo "Please run ir_loopback test as root [SKIP]"
|
|
exit $ksft_skip
|
|
fi
|
|
|
|
if ! /sbin/modprobe -q -n rc-loopback; then
|
|
echo "ir_loopback: module rc-loopback is not found in /lib/modules/`uname -r` [SKIP]"
|
|
exit $ksft_skip
|
|
fi
|
|
|
|
/sbin/modprobe rc-loopback
|
|
if [ $? -ne 0 ]; then
|
|
exit
|
|
fi
|
|
|
|
RCDEV=$(grep -l DRV_NAME=rc-loopback /sys/class/rc/rc*/uevent | grep -o 'rc[0-9]\+')
|
|
|
|
./ir_loopback $RCDEV $RCDEV
|
|
exit
|