15477b31db
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>
26 lines
552 B
Bash
Executable File
26 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
|