Tiny Core Base > Raspberry Pi
How to compile a kernel module with source from vendor?
mikedev:
I know how to compile programs into tcz from source.
So, how to compile kernel module into .ko from source provided by vendor or git clone?
Any general tutorial or guidelines?
Threads from google of compiling kernel modules in debian/ubuntu mentioned about "dkms", is it necessary in TC/piCore?
More detail is, I have an usb wireless adapter 8192cu, which works flawlessly with piCore8beta1 (4.4.11) but it is NOT working in beta4 (4.4.15).
I would like to try compiling this kernel module from realtek source or some git clone mentioned the "fix".
Thanks.
Greg Erskine:
Hi mikedev,
I have been chasing these wifi issues and have found this improves the situation:
Change wifi-wpadrv and add to /opt/.filetool.lst
--- Code: ---From:
$ cat /etc/sysconfig/wifi-wpadrv
wext
To:
$ cat /etc/sysconfig/wifi-wpadrv
nl80211,wext
--- End code ---
I find this wifi adaptor now works 80% to 90% of the time.
(BTW: I didn't test the kernel 4.1.xx setup to verify if it was working 100%, I suspect not. I had been using this wifi adaptor successfully for over a year.)
wifi adaptor details:
--- Code: ---Report diag_wifi.cgi generated on Sat Aug 20 07:35:49 EST 2016
_ _____ ___ __
___ (_) ___/__ _______ / _ \/ /__ ___ _____ ____
/ _ \/ / /__/ _ \/ __/ -_) ___/ / _ `/ // / -_) __/
/ .__/_/\___/\___/_/ \__/_/ /_/\_,_/\_, /\__/_/
/_/ /___/
piCorePlayer = piCore + Squeezelite + Raspberry Pi
The software is provided "as is" without warranty of any kind,
either express or implied, including without limitation any implied
warranties of condition, uninterrupted use, merchantability,
fitness for a particular purpose, or non-infringement.
=========================================================================================
Wifi: on
SSID: GEwireless2
Password: xxxxxxx
Security: WPA
MAC address: 00:28:01:71:d0:24
Uptime: 4 days 0 hours 18 minutes 30 seconds
=========================================================================================
dmesg
=========================================================================================
[ 3.294733] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8176
[ 3.294749] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.294760] usb 1-1.2: Product: 802.11n WLAN Adapter
[ 3.294771] usb 1-1.2: Manufacturer: Realtek
[ 3.294783] usb 1-1.2: SerialNumber: 00e04c000001
.
lsmod
=========================================================================================
Module Size Used by Not tainted
8192cu 568110 0
cfg80211 440795 1 8192cu
rfkill 16702 2 cfg80211
squashfs 29704 21
zram 21852 1
zsmalloc 12458 1 zram
lz4_compress 3028 1 zram
wifi usb report (lsusb)
=========================================================================================
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
iwconfig
=========================================================================================
wlan0 IEEE 802.11bgn ESSID:"GEwireless2" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.452 GHz Access Point: 00:04:ED:C9:57:B8
Bit Rate:150 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:****-****-****-****-****-****-****-**** Security mode:open
Power Management:off
Link Quality=89/100 Signal level=71/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
ifconfig
=========================================================================================
wlan0 Link encap:Ethernet HWaddr 00:28:01:71:D0:24
inet addr:192.168.1.155 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14828603 errors:0 dropped:462364 overruns:0 frame:0
TX packets:2496518 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1290626924 (1.2 GiB) TX bytes:251438066 (239.7 MiB)
iwlist
=========================================================================================
wlan0 Scan completed :
Cell 01 - Address: C4:EA:1D:B3:07:CB
ESSID:"TelstraB307CB"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:130 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD980050F204104A00011010440001021057000101103B000103104700101519F3997A305259A09F8F92113204591021000B546563686E69636F6C6F721023000E546563686E69636F6C6F7220544710240006373939766163104200093135343853413855531054000800060050F204000110110014546563686E69636F6C6F7220544737393976616310080002268C1049000600372A000120
Quality=94/100 Signal level=44/100
Cell 02 - Address: C6:EA:1D:B3:07:CD
ESSID:"Telstra Air"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:off
Bit Rates:130 Mb/s
Quality=78/100 Signal level=42/100
Cell 03 - Address: C6:EA:1D:B3:07:CE
ESSID:"Fon WiFi"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:off
Bit Rates:130 Mb/s
Quality=34/100 Signal level=42/100
Cell 04 - Address: 00:04:ED:C9:57:B8
ESSID:"GEwireless2"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.452 GHz (Channel 9)
Encryption key:on
Bit Rates:300 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Quality=89/100 Signal level=71/100
Cell 05 - Address: 00:1B:2F:74:C9:D8
ESSID:"NETGEAR"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:54 Mb/s
Quality=96/100 Signal level=47/100
Cell 06 - Address: 30:91:8F:2F:BC:C3
ESSID:"Telstra2FBCC3"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:on
Bit Rates:130 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD9A0050F204104A00011010440001021057000101103B0001031047001056B110A696C559EFBB435E0DB8C4857C1021000B546563686E69636F6C6F721023000E546563686E69636F6C6F72205447102400073739376E207633104200093134333054414144301054000800060050F204000110110015546563686E69636F6C6F722054473739376E20763310080002268C1049000600372A000120
Quality=56/100 Signal level=23/100
Cell 07 - Address: 32:91:8F:2F:BC:C5
ESSID:"Telstra Air"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:130 Mb/s
Quality=44/100 Signal level=19/100
Cell 08 - Address: 32:91:8F:2F:BC:C6
ESSID:"Fon WiFi"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:130 Mb/s
Quality=41/100 Signal level=15/100
---------------------------------------------------------------------------------------------
SSID Quality Level Channel Encryption Address
---------------------------------------------------------------------------------------------
1. NETGEAR 96 47/100 11 (2.462GHz) off NONE 00:1B:2F:74:C9:D8
2. TelstraB307CB 94 44/100 6 (2.437GHz) on WPA2 C4:EA:1D:B3:07:CB
3. GEwireless2 92 71/100 9 (2.452GHz) on WPA2 00:04:ED:C9:57:B8
4. Telstra Air 78 42/100 6 (2.437GHz) off NONE C6:EA:1D:B3:07:CD
5. Telstra2FBCC3 56 23/100 11 (2.462GHz) on WPA2 30:91:8F:2F:BC:C3
6. Telstra Air 44 19/100 11 (2.462GHz) off NONE 32:91:8F:2F:BC:C5
7. Fon WiFi 41 15/100 11 (2.462GHz) off NONE 32:91:8F:2F:BC:C6
8. Fon WiFi 34 42/100 6 (2.437GHz) off NONE C6:EA:1D:B3:07:CE
---------------------------------------------------------------------------------------------
--- End code ---
regards
Greg
Paul_123:
There is a vendor driver in the kernel, it is just disabled in the config. I'll look it up for you
Paul_123:
Can you point me to the "FIX" you are referring to?
The realtek vendor drivers are disabled in the current kernel. The old 8192cu has been getting small patches to make it work with hostapd and modern mac80211/nl80211. But there are just too many variants of the rtl8188 chipset to make it work reliably. There is another promising driver coming up, but it's not fully developed. RTL8xxxu. But it might work with in 8192cu mode.
The easiest way would be to apply the patch you mentioned to the kernel or replace the appropriate kernel source with the source you want. Or enable one of the above drivers and then build in tree.
Download the kernel source/config/System.map/Module.symvers from http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/ If you have an armv6 board, just change the above link to armv6
Expand the kernel source
expand the .config Module.symvers and the System.map and place in the root of the kernel build directory
To enable the rtlwifi vendor drivers
edit the file drivers/net/wireless/Kconfig
-scroll to the end of the file and uncomment this line source "drivers/net/wireless/realtek/rtlwifi/Kconfig"
edit the file drivers/net/wireless/realtek/Makefile
-remove the comment from the line obj-$(CONFIG_RTLWIFI) += rtlwifi/
run make menuconfig
navigate to Device Drivers/Network device support/Wireless Lan/
make sure "Realtek rtlwifi family of devices" is set to <m>
You may choose to enable RTL8XXXU as well
Save the config
Exit
To build single modules do this. (This will build the Realtek vendor driver rtl8192cu.ko)
make modules_prepare
make SUBDIRS=drivers/net/wireless/realtek/rtlwifi modules
Then goto driver/net/wireless/realtek/rtlwifi/rtl8192cu/ and you will find your new module.
Obviously if you have more than one driver on your system for your card, it will confuse the kernel, so either blacklist drivers or load/unload them manually with modprobe
mikedev:
--- Quote from: Greg Erskine on August 19, 2016, 05:51:36 PM ---Hi mikedev,
I have been chasing these wifi issues and have found this improves the situation:
Change wifi-wpadrv and add to /opt/.filetool.lst
--- Code: ---From:
$ cat /etc/sysconfig/wifi-wpadrv
wext
To:
$ cat /etc/sysconfig/wifi-wpadrv
nl80211,wext
--- End code ---
I find this wifi adaptor now works 80% to 90% of the time.
(BTW: I didn't test the kernel 4.1.xx setup to verify if it was working 100%, I suspect not. I had been using this wifi adaptor successfully for over a year.)
wifi adaptor details:
--- Code: ---Report diag_wifi.cgi generated on Sat Aug 20 07:35:49 EST 2016
_ _____ ___ __
___ (_) ___/__ _______ / _ \/ /__ ___ _____ ____
/ _ \/ / /__/ _ \/ __/ -_) ___/ / _ `/ // / -_) __/
/ .__/_/\___/\___/_/ \__/_/ /_/\_,_/\_, /\__/_/
/_/ /___/
piCorePlayer = piCore + Squeezelite + Raspberry Pi
The software is provided "as is" without warranty of any kind,
either express or implied, including without limitation any implied
warranties of condition, uninterrupted use, merchantability,
fitness for a particular purpose, or non-infringement.
=========================================================================================
Wifi: on
SSID: GEwireless2
Password: xxxxxxx
Security: WPA
MAC address: 00:28:01:71:d0:24
Uptime: 4 days 0 hours 18 minutes 30 seconds
=========================================================================================
dmesg
=========================================================================================
[ 3.294733] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8176
[ 3.294749] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.294760] usb 1-1.2: Product: 802.11n WLAN Adapter
[ 3.294771] usb 1-1.2: Manufacturer: Realtek
[ 3.294783] usb 1-1.2: SerialNumber: 00e04c000001
.
lsmod
=========================================================================================
Module Size Used by Not tainted
8192cu 568110 0
cfg80211 440795 1 8192cu
rfkill 16702 2 cfg80211
squashfs 29704 21
zram 21852 1
zsmalloc 12458 1 zram
lz4_compress 3028 1 zram
wifi usb report (lsusb)
=========================================================================================
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
iwconfig
=========================================================================================
wlan0 IEEE 802.11bgn ESSID:"GEwireless2" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.452 GHz Access Point: 00:04:ED:C9:57:B8
Bit Rate:150 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:****-****-****-****-****-****-****-**** Security mode:open
Power Management:off
Link Quality=89/100 Signal level=71/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
ifconfig
=========================================================================================
wlan0 Link encap:Ethernet HWaddr 00:28:01:71:D0:24
inet addr:192.168.1.155 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14828603 errors:0 dropped:462364 overruns:0 frame:0
TX packets:2496518 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1290626924 (1.2 GiB) TX bytes:251438066 (239.7 MiB)
iwlist
=========================================================================================
wlan0 Scan completed :
Cell 01 - Address: C4:EA:1D:B3:07:CB
ESSID:"TelstraB307CB"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:130 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD980050F204104A00011010440001021057000101103B000103104700101519F3997A305259A09F8F92113204591021000B546563686E69636F6C6F721023000E546563686E69636F6C6F7220544710240006373939766163104200093135343853413855531054000800060050F204000110110014546563686E69636F6C6F7220544737393976616310080002268C1049000600372A000120
Quality=94/100 Signal level=44/100
Cell 02 - Address: C6:EA:1D:B3:07:CD
ESSID:"Telstra Air"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:off
Bit Rates:130 Mb/s
Quality=78/100 Signal level=42/100
Cell 03 - Address: C6:EA:1D:B3:07:CE
ESSID:"Fon WiFi"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:off
Bit Rates:130 Mb/s
Quality=34/100 Signal level=42/100
Cell 04 - Address: 00:04:ED:C9:57:B8
ESSID:"GEwireless2"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.452 GHz (Channel 9)
Encryption key:on
Bit Rates:300 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Quality=89/100 Signal level=71/100
Cell 05 - Address: 00:1B:2F:74:C9:D8
ESSID:"NETGEAR"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:54 Mb/s
Quality=96/100 Signal level=47/100
Cell 06 - Address: 30:91:8F:2F:BC:C3
ESSID:"Telstra2FBCC3"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:on
Bit Rates:130 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD9A0050F204104A00011010440001021057000101103B0001031047001056B110A696C559EFBB435E0DB8C4857C1021000B546563686E69636F6C6F721023000E546563686E69636F6C6F72205447102400073739376E207633104200093134333054414144301054000800060050F204000110110015546563686E69636F6C6F722054473739376E20763310080002268C1049000600372A000120
Quality=56/100 Signal level=23/100
Cell 07 - Address: 32:91:8F:2F:BC:C5
ESSID:"Telstra Air"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:130 Mb/s
Quality=44/100 Signal level=19/100
Cell 08 - Address: 32:91:8F:2F:BC:C6
ESSID:"Fon WiFi"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:130 Mb/s
Quality=41/100 Signal level=15/100
---------------------------------------------------------------------------------------------
SSID Quality Level Channel Encryption Address
---------------------------------------------------------------------------------------------
1. NETGEAR 96 47/100 11 (2.462GHz) off NONE 00:1B:2F:74:C9:D8
2. TelstraB307CB 94 44/100 6 (2.437GHz) on WPA2 C4:EA:1D:B3:07:CB
3. GEwireless2 92 71/100 9 (2.452GHz) on WPA2 00:04:ED:C9:57:B8
4. Telstra Air 78 42/100 6 (2.437GHz) off NONE C6:EA:1D:B3:07:CD
5. Telstra2FBCC3 56 23/100 11 (2.462GHz) on WPA2 30:91:8F:2F:BC:C3
6. Telstra Air 44 19/100 11 (2.462GHz) off NONE 32:91:8F:2F:BC:C5
7. Fon WiFi 41 15/100 11 (2.462GHz) off NONE 32:91:8F:2F:BC:C6
8. Fon WiFi 34 42/100 6 (2.437GHz) off NONE C6:EA:1D:B3:07:CE
---------------------------------------------------------------------------------------------
--- End code ---
regards
Greg
--- End quote ---
Thanks Greg, I have tried yours but it doesn't work on my case.
My wlan interface can be brought up, that's it, unable to connect to ap with wpa_supplicant nor serve as ap with hostapd, under 8beta4.
However, it works very fine under 8beta1, can connect to ap, can serve as ap with hostapd. Haven't tried 8beta2 or beta3.
Strange...
Thanks your suggestion!
Navigation
[0] Message Index
[#] Next page
Go to full version