Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insmod on mt7601Usta.ko fails with invalid module format #1

Open
ghost opened this issue Apr 25, 2015 · 7 comments
Open

insmod on mt7601Usta.ko fails with invalid module format #1

ghost opened this issue Apr 25, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Apr 25, 2015

I have a Raspberry 2 and a WIFI dongle which has a ralink chipset 7601.
Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp.
I've been trying to get it working in the last few days with no success.
I have followed all the steps in this tutorial https://github.com/Yackou/nixie-radio/wiki/mt7601u-compilation.
I have the same exact software and hardware setup as in the article. I've followed the steps a few times now but it always fails at the last step sudo insmod os/linux/mt7601Usta.ko
with: Error: could not insert module os/linux/mt7601Usta.ko: Invalid module format

Do you know what might cause this and how I can fix it?

@Yackou
Copy link
Owner

Yackou commented Apr 25, 2015

It looks like your module wasn't compiled for the same version as the kernel you're running.
What is the output of these 2 commands:
uname -a
and:
modinfo os/linux/mt7601Usta.ko
?

@ghost
Copy link
Author

ghost commented Apr 25, 2015

The uname -a returns:
Linux rpi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

and the modinfo returns:
filename: /home/pi/mt7601/src/os/linux/mt7601Usta.ko
version: 3.0.0.3
description: RT2870 Wireless Lan Linux Driver
author: Paul Lin [email protected]
license: GPL
srcversion: 524D488BC9D4D1F53D7DA27
alias: usb:v2955p1003d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v2955p1001d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v2955p0001d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v2A5Fp1000d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v148Fp760Bd_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v148Fp7601d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v148Fp6370d_dc_dsc_dp_ic_isc_ip_in_
alias: usb:v148Fp7650d_dc_dsc_dp_ic_isc_ip_in_
depends:
vermagic: 3.18.7-v7+ SMP preempt mod_unload modversions ARMv7
parm: mac:rt28xx: wireless mac addr (charp)

I also tried upgrading the GCC to 4.8 but no difference.
I tried renaming the file Module7.symvers to Module.symvers in the /usr/src/linux folder. With this the compilation is ok but the insmod command returns a kernel error.

@Yackou
Copy link
Owner

Yackou commented Apr 25, 2015

Those look correct, and exactly the same as on my system.
Could you provide the md5sums of Module7.symvers, and of the kernel config file (.config.org or /proc/config.gz)? It's a bit late tonight but I'll check those tomorrow, and upload the .ko I'm using successfully for you to try as well. Assuming the kernel sources are the same, those 2 files are the only things that could make a driver incompatible with the kernel.
Also, is there any additional info in dmesg maybe?

@ghost
Copy link
Author

ghost commented Apr 26, 2015

The md5sum on the Module7.symvers is:
d7d388b8239fb7f1c690d1963d0df982 Module7.symvers
The md5sum on the .config.org is:
602130564b0bf9327081ffc545809464 .config.org
The md5sum on the /proc/config.gz is:
01684da6368edfc572621fd7cd1598ff config.gz
In the dmesg i get:
[ 1684.364829] mt7601Usta: no symbol version for module_layout

Thank you for taking your time with this issue. It has been a pain the last few days to try and get it to work.

@Yackou
Copy link
Owner

Yackou commented Apr 26, 2015

This definitely looks the same as on my setup.
A bit of digging on the net suggests that the Module.symvers file may not have been picked up during compilation of the wifi kernel module (see in particular: http://askubuntu.com/questions/14627/no-symbol-version-for-module-layout-when-trying-to-load-usbhid-ko). I checked on my own system, and I do have a Module.symvers identical to Module7.symvers (probably from earlier trials), so it now seems likely that my instructions were not entirely correct: could you try again after renaming Module7.symvers to Module.symvers?
Since you tried that already, what was the kernel error message during insmod? Did you try compiling the kernel module from clean sources?

@ghost
Copy link
Author

ghost commented Apr 27, 2015

I've reinstalled the OS yesterday because it was broken.
I've retraced all the steps from your instructions but with renaming Module7.symvers to Module.symvers. Now it didn't throw any error and it worked! So i think this step needs to be mentioned in the instructions I also looked at the steps taken here: https://github.com/porjo/mt7601/issues/18 and indeed there is a rename for the file.
Thank you very much for your help!

@Yackou
Copy link
Owner

Yackou commented Apr 27, 2015

Great, glad to know it's working now!
And sorry for the miss. I've already updated the instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant