我正在尝试安装华为调制解调器软件。但尚未安装。显示如下:
bhaskar@bhaskar:~$ cd Desktop/driver
bhaskar@bhaskar:~/Desktop/driver$ sudo ./install
old path =/usr/local/Mobile_Partner/driver
FATAL: Module option is in use.
DRIVER COPY START
STA_PATH_FLAG=.
STA_PATH_FULL=/home/bhaskar/Desktop/driver/install
START_PATH_DRIVER=/home/bhaskar/Desktop/driver
CURRENT install from ./install
INSTALL_PATH is not set ,auto install
INSTALL_PATH=/usr/local/Mobile_Partner
INSTALL_PATH is another path
rm /usr/local/Mobile_Partner/driver
DRIVER COPY END
ls: cannot access /etc/usb_modeswitch.d/: No such file or directory
/usr/local/Mobile_Partner/driver/ndis_driver
Error: missing module or filename.
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'cdc_ether': No such file or directory
Error: could not remove module cdc_ether: No such file or directory
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'usbnet': Resource temporarily unavailable
Error: could not remove module usbnet: Resource temporarily unavailable
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'hw_cdc_driver': No such file or directory
Error: could not remove module hw_cdc_driver: No such file or directory
make -C src/ clean
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh "clean" "/lib/modules/3.8.0-19-generic/build/include/linux/usb"
rmmod -f hw_cdc_driver
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'hw_cdc_driver': No such file or directory
Error: could not remove module hw_cdc_driver: No such file or directory
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [clean] Error 2
make -C src/ modules
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
#/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh "modules" "/lib/modules/3.8.0-19-generic/build/include/linux/usb"
make -C /lib/modules/3.8.0-19-generic/build SUBDIRS=/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src modules
make[2]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
CC [M] /usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.o
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_ncm_prefer_32’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:113:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_ncm_prefer_crc’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:116:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_rt_debug’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:128:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘hw_change_mtu’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:899:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘rx_tlp_parse’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:1085:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘tx_complete’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:1663:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘cdc_ncm_config’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2036:24: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2037:3: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2037:3: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2041:21: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2057:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘hw_cdc_probe’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2589:3: error: implicit declaration of function ‘dbg’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.o] Error 1
make[2]: *** [_module_/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [modules] Error 2
make -C src/ install
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
#install -m 744 -c hw_cdc_driver.o /lib/modules/3.8.0-19-generic/kernel/drivers/usb/net
#depmod -a
#modprobe hw_cdc_driver
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh "install"
modprobe hw_cdc_driver
FATAL: Module hw_cdc_driver not found.
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [install] Error 2
Install NDIS driver failed.
The compiling environment is not all ready.
Please check gcc, make and kernel buid(/lib/modules/3.8.0-19-generic/build) to be all installed?
Now please enter any key to finish other installations.
lNDIS is disabled, and only Modem can be used.
TARGET_PATH =
TARGET_PATH =
have usb_modeswitch rules to HUAWEI DataCard: COUNT=0
ADDRUNLEVEL=/etc/rc4.d
‘/etc/rc4.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc4.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc5.d
‘/etc/rc5.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc5.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc2.d
‘/etc/rc2.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc2.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc3.d
‘/etc/rc3.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc3.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
bhaskar@bhaskar:~/Desktop/driver$
请告诉我如何解决这个问题。我尝试过其他版本的 Mobile Partner 软件。所有版本的问题都一样。
谢谢,Bhaskar
答案1
问题在于:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2589:3: error: implicit declaration of function ‘dbg’ [-Werror=implicit-function-declaration]
我的另一个华为调制解调器驱动程序也遇到了类似的问题,我修复了源代码。
首先,让我们找出hw_cdc_driver.c
文件在哪里。file
对目录中的所有文件运行该命令~/Desktop/driver
:
file *
您将看到其中一些是“7-zip 存档数据”文件。7z l
对每个文件运行,以查看内容:
7z l data.bin
可能是文件太多了,所以你可以只grep
查找你要找的文件:
7z l data.bin | grep hw_cdc_driver.c
如果找到了,则需要提取该档案。
mkdir data_bin
mv data.bin data_bin
cd data_bin
7z x data.bin
rm data.bin
现在,目录中就有了存档的内容data_bin
。搜索文件hw_cdc_driver.c
,打开它,然后转到第 2589 行(错误所在行)。您可以注释掉包含该行的内容(在行前面dbg
添加一个),然后保存并关闭文件。//
要将修改后的文件打包到档案中,请7z
再次使用:
cd data_bin
7z a data.bin data_bin
mv data.bin ..
现在您已data.bin
用修复后的文件进行了替换。请尝试再次安装。