rmmod失败的问题

测试驱动的时候,发现一个问题,就是实验了千百种方法,都无发正常的rmmod,幸亏,在一个bbs上看到了一个答复,实验了一下,成功了,在此记录一下,也为同样碰到问题的朋友提个醒。


问题描述:RMMOD总是无法成功


解决:前提是,确定自己内核各方面都正确设置无误,那么就剩下这个可能了,gcc版本不对,也就是说,你的测试目标机内核和你的驱动的gcc版本不一样。

更换成目标机器的gcc版本,问题解决!



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
解释脚本:#!/bin/bash #version: 0.1.0 20230510 totalstarttime=$(date +%s) # 计算间隔时间 pkg_name=`pwd |sed 's/\// /g'| awk '{print$NF}'` SWITCH_FW=${pkg_name::-8}"SIGN.fw" cd `pwd` G4XDIAG=./g4Xdiagnostics.x86_64 result_log=SR6295A_793_PCIeFW_UPDATE_`date '+%Y%m%d%H%M%S'`.log mpt_cnt=`lsmod | grep -i mpt3sas | wc -l` if [ $mpt_cnt != 0 ];then rmmod mpt3sas fi mpt3sas_driver=`ls | grep "mpt3sas-"` tar -zxvf $mpt3sas_driver cd mpt3sas/ ./compile.sh ./load.sh cd ../ echo -e "\n Switch Firmware Is Upgrading!!! \n" CNT=`$G4XDIAG -i 1 list | grep "MPI" | wc -l` echo "FW Image Is:" >> $result_log echo $SWITCH_FW | grep "SR6295A_793" >> $result_log if [ $? != 0 ]; then echo "PCIe FW Name Is Not Matched!" >> $result_log echo -e "\n FAIL: PCIe FW Name Is Not Matched! \n" exit 1 else if [ $CNT != 4 ];then echo "Lost switch!" >> $result_log $G4XDIAG -i 1 list >> $result_log echo -e "\n FAIL: Lost switch \n" exit 1 fi fi #Check platform for i in $(seq 1 1 $CNT) do hq_cmd=`$G4XDIAG -i $i cli showloc | grep "Current Switch Location" | wc -l` if [ $hq_cmd == 0 ];then echo -e "\n Platform Is Not Matched! \n" >> $result_log echo -e "\n FAIL:Platform Is Not Matched!\n" exit 1 fi done #FW upgrade for i in $(seq 1 1 $CNT) do $G4XDIAG -i $i cli showloc >> $result_log $G4XDIAG -i $i dl -f $SWITCH_FW -s >> $result_log ret=`cat $result_log | tail -n 5 | grep -i "successfully" | wc -l` if [ $ret == 1 ];then echo -e "\n Switch FW Download SUCCESS!!! \n" >> $result_log else echo -e "\n Switch FW Download FAIL!!! \n" >> $result_log echo -e "\n Switch FW Download FAIL!!! \n" exit 1 fi done echo -e "\n Upgrade PASS!!! Need restart the system to make the fresh image active! \n" totalendtime=$(date +%s) echo -e "\n Total FW update finished! Total cost time : $(( $totalendtime - $totalstarttime )) s\n" >> $result_log sleep 5 exit 0
07-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值