Skip to content

Instantly share code, notes, and snippets.

@rgo
Forked from probonopd/kernel_module.sh
Created November 4, 2017 22:34
Show Gist options
  • Save rgo/97697ba850674f05eeed96bc8d44fabd to your computer and use it in GitHub Desktop.
Save rgo/97697ba850674f05eeed96bc8d44fabd to your computer and use it in GitHub Desktop.
Trying to compile kernel module for Ralink 3070 chipset
#
# Trying to compile kernel module for Ralink 3070 chipset
# with patch described on
# http://www.geekamole.com/2013/rt2800usb-fix-for-ralinkmediatek-3070-gentoo-linux/
#
apt-get install linux-headers-3.7-trunk-686-pae # This is on Kali Linux; 3 MB
apt-get install linux-source-3.7 # http://ftp.halifax.rwth-aachen.de/kali/pool/main/l/linux-kali/linux-source-3.7_3.7.2-0+kali8_all.deb # 82 MB
tar xfj /usr/src/linux-source-3.7.tar.bz2
cd linux-*
cp /boot/config* .config
# The following is Very important, otherwise the .ko will not load
# with "no symbol version for module_layout"
cp /usr/src/linux-headers-3.7-trunk-686-pae/Module.symvers .
make prepare
make scripts
# Patch USB ID 0x184f:0x3070 into the driver
find ./drivers/net/wireless/rt2x00/ -type f -exec sed -i -e 's|RF5370|RF3070|g' {} \;
make M=drivers/net/wireless/rt2x00/
cp ./drivers/net/wireless/rt2x00/rt* /lib/modules/3.7-trunk-686-pae/kernel/drivers/net/wireless/rt2x00/
rmmod rt2800usb rt2x00usb rt2800lib rt2x00lib
# insert Ralink USB dongle
dmesg
# No more rt2x00lib: no symbol version for module_layout :-)
# But the issue persists:
# [ 936.188046] usb 1-1: new high-speed USB device number 12 using ehci_hcd
# [ 936.337509] usb 1-1: New USB device found, idVendor=148f, idProduct=3070
# [ 936.337513] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
# [ 936.337517] usb 1-1: Product: 802.11 n WLAN
# [ 936.337521] usb 1-1: Manufacturer: Ralink
# [ 936.337524] usb 1-1: SerialNumber: 1.0
# [ 936.468051] usb 1-1: reset high-speed USB device number 12 using ehci_hcd
# [ 936.625629] phy6 -> rt2800_init_eeprom: Error - Invalid RF chipset 0x3070 detected.
# [ 936.625635] phy6 -> rt2x00lib_probe_dev: Error - Failed to allocate device.
# [ 936.625682] usbcore: registered new interface driver rt2800usb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment