delete usb3_script

This commit is contained in:
Qubot 2025-04-08 15:15:00 +08:00
parent fa83cf7dac
commit 5efed997d0
5 changed files with 4 additions and 237 deletions

View File

@ -1,29 +0,0 @@
#/bin/bash
RET=0
sleep 2
echo " "
echo " "
echo " "
echo "######################################################################################"
echo "########################### M.2 KeyB USB3.0 Testing Start ##########################"
result=`lsusb | grep "2c7c:0900" | wc -l`
if [ ${result} -eq 1 ]; then
echo "### Find one RM500U-CN 5G Module from M.2 KeyB slots ###"
else
echo "Error Notice: Can not Find one RM500U-CN 5G Module from M.2 KeyB slots"
RET=1
fi
echo "######################################################################################"
echo " "
echo " "
echo " "
sleep 2
return ${RET}

View File

@ -1,67 +0,0 @@
SYS_FILE=/sys/class/gpio
mt_gpio_export()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
if [ ! -f ${SYS_FILE}/export ]; then
echo "${SYS_FILE}/export file is not present"
exit 1
fi
echo "${pin}" > ${SYS_FILE}/export
return 0
}
mt_gpio_dir()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
dir=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/direction ]; then
echo "${SYS_FILE}/gpio${pin}/direction is not present"
exit 1
fi
echo "${dir}" > ${SYS_FILE}/gpio${pin}/direction
return 0
}
mt_gpio_out()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
out=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
echo "${SYS_FILE}/gpio${pin}/value is not present"
exit 1
fi
echo "${out}" > ${SYS_FILE}/gpio${pin}/value
return 0
}
mt_gpio_in()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
echo "${SYS_FILE}/gpio${pin}/value is not present"
exit 1
fi
result=`cat ${SYS_FILE}/gpio${pin}/value`
if [ ${result} == "0" ] ; then
return 0
else
return 1
fi
}

View File

@ -4,7 +4,7 @@ SYS_FILE=/sys/class/gpio
mt_gpio_export()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
let pin=pin+471 ### gpio base 471 ###
if [ ! -f ${SYS_FILE}/export ]; then
echo "${SYS_FILE}/export file is not present"
@ -19,7 +19,7 @@ mt_gpio_export()
mt_gpio_dir()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
let pin=pin+471 ### gpio base 471 ###
dir=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/direction ]; then
@ -35,7 +35,7 @@ mt_gpio_dir()
mt_gpio_out()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
let pin=pin+471 ### gpio base 471 ###
out=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
@ -51,7 +51,7 @@ mt_gpio_out()
mt_gpio_in()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
let pin=pin+471 ### gpio base 471 ###
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
echo "${SYS_FILE}/gpio${pin}/value is not present"

View File

@ -1,67 +0,0 @@
SYS_FILE=/sys/class/gpio
mt_gpio_export()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
if [ ! -f ${SYS_FILE}/export ]; then
echo "${SYS_FILE}/export file is not present"
exit 1
fi
echo "${pin}" > ${SYS_FILE}/export
return 0
}
mt_gpio_dir()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
dir=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/direction ]; then
echo "${SYS_FILE}/gpio${pin}/direction is not present"
exit 1
fi
echo "${dir}" > ${SYS_FILE}/gpio${pin}/direction
return 0
}
mt_gpio_out()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
out=$2
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
echo "${SYS_FILE}/gpio${pin}/value is not present"
exit 1
fi
echo "${out}" > ${SYS_FILE}/gpio${pin}/value
return 0
}
mt_gpio_in()
{
pin=$1
let pin=pin+428 ### gpio base 428 ###
if [ ! -f ${SYS_FILE}/gpio${pin}/value ]; then
echo "${SYS_FILE}/gpio${pin}/value is not present"
exit 1
fi
result=`cat ${SYS_FILE}/gpio${pin}/value`
if [ ${result} == "0" ] ; then
return 0
else
return 1
fi
}

View File

@ -1,70 +0,0 @@
#/bin/bash
### This script is to check if USB3.0 USB2.0 ports are working fine ###
RET=0
sleep 2
echo " "
echo " "
echo " "
echo "######################################################################################"
echo "########################## USB3.0 Deivce Testing Start ##########################"
dmesg -c > /dev/null
while true
do
read -t20 -s -n1 -p "### Please Insert one USB3.0 Device U-DISK right now , then enter any key to continue. ###" keypress
if [ $? -eq 0 ]; then
echo " "
break
fi
echo " "
done
sleep 3
result=`dmesg | grep "new SuperSpeed" | wc -l`
if [ ${result} -eq 0 ]; then
RET=1
echo "Error Notice: USB3.0 Device U-DISK can not detect at first time."
else
result=`dmesg | grep "Attached SCSI removable disk" | wc -l`
if [ ${result} -eq 0 ]; then
RET=1
echo "Error Notice: USB3.0 Device U-DISK can not detect at second time."
else
echo "### USB3.0 Device U-DISK can detect successfully ###"
result=`fdisk -l /dev/sda | grep "bytes" | grep "sectors" | wc -l`
if [ ${result} -gt 0 ]; then
echo "### USB3.0 Device U-DISK partition info is good ###"
else
RET=1
echo "Error Notice: USB3.0 Device U-DISK partition info is bad"
fi
fi
fi
sleep 1
while true
do
read -t20 -s -n1 -p "### Please Remove one USB3.0 Device U-DISK right now , then enter any key to continue. ###" keypress
if [ $? -eq 0 ]; then
echo " "
break
fi
echo " "
done
sleep 3
dmesg -c > /dev/null
echo "######################################################################################"
echo " "
echo " "
echo " "
sleep 2
return ${RET}