Tiny Core Base > Raspberry Pi

How to compile a kernel module with source from vendor?

<< < (2/3) > >>

mikedev:

--- Quote from: Paul_123 on August 19, 2016, 10:51:46 PM ---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

--- End quote ---

This is one of those "fix" links that I would like to try...
http://askubuntu.com/questions/246236/compile-and-install-rtl8192cu-driver
Most other searches from google also utilize the git of "https://github.com/pvaret/rtl8192cu-fixes.git"

Thanks Paul, I would try your solution when I have time.
That's weird to me that the wireless adapter works perfectly under 8beta1 as client or master but not under 8beta4.

I basically have trimmed 2 memory cards (1 for beta1, 1 for beta4) for troubleshooting that each only contain the partition 1, and the partition 2 with wifi.tcz and its dependency.  The issue is repeatable by swapping memory card on the same pi.
Issue must be either from wireless-4.4.15-piCore+ or kernel since this is the only difference.

I doubt on the driver that's why I would like to try (re)compile the driver part...

Thanks.

Paul_123:

--- Quote from: mikedev on August 22, 2016, 01:49:53 PM ---
This is one of those "fix" links that I would like to try...
http://askubuntu.com/questions/246236/compile-and-install-rtl8192cu-driver
Most other searches from google also utilize the git of "https://github.com/pvaret/rtl8192cu-fixes.git"

Thanks Paul, I would try your solution when I have time.
That's weird to me that the wireless adapter works perfectly under 8beta1 as client or master but not under 8beta4.

I basically have trimmed 2 memory cards (1 for beta1, 1 for beta4) for troubleshooting that each only contain the partition 1, and the partition 2 with wifi.tcz and its dependency.  The issue is repeatable by swapping memory card on the same pi.
Issue must be either from wireless-4.4.15-piCore+ or kernel since this is the only difference.

I doubt on the driver that's why I would like to try (re)compile the driver part...

Thanks.

--- End quote ---

There was a change to the kernel source for this driver after 8.0Beta1.     Here is the pull request that was merged into the RPI kernel
https://github.com/raspberrypi/linux/pull/1488.   You will notice it includes a port of the pvaret driver fixes.

I don't think I ever tested beta 1.   If the beta 1 drivers worked, that is the source I would grab.   If you clone the RPI kernel github, you should be able to revert that commit and grab that code.

For me I'm really considering to drop all of my RTL8188 based sticks.

mikedev:

--- Quote from: Paul_123 on August 19, 2016, 10:51:46 PM ---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

--- End quote ---

Paul, first, thank you very much again!  Your detail steps of instruction are very useful.  I learned new stuffs from your instruction in compiling an additional vendor's driver as module from the source.  Very cool!  BTW, would you share where I can learn more about these kernel/module compilation tutorial or documentation?

The compilation works perfectly, however, ran into another problem:
under 4.4.15/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/, there is rtl8192cu.ko, I copied this file into /usr/local/lib/modules/4.4.15-piCore+/kernel/drivers/net/wireless/realtek/rtl8192cu, and then

--- Quote ---sudo depmod -a
sudo modprobe rtl8192cu
modprobe: can't load module rtl8192cu (kernel.tclocal/drivers/net/wireless/realtek/rtl8192cu/rtl8192cu.ko): invalid module format

--- End quote ---

Any idea why the module format is invalid???

This is the line from syslog:

--- Quote ---[363086.698396] rtl8192cu: no symbol version for module_layout
--- End quote ---

Paul_123:
Make sure you grabbed the right source files for armv6 or armv7

Otherwise, there may be other updates not done to that driver to be compatible with 4.4.x kernels.


I've just been doing this a while.  Google for info, and save notes.  No particular sites

ovacikar:
Hi Paul, giving this a try , compiling rtl8xxxu on picore 15 armhf.

The kernel source folder has separate v7 and v7l files for .config, system map etc. Which files do i need for armhf , the plain ones with 18:53 timestamp?


--- Code: ---http://www.tinycorelinux.net/15.x/armhf/releases/RPi/src/kernel/

6.6.47-piCore-v7_.config                           31-Aug-2024 18:59              210719
6.6.47-piCore-v7_Module.symvers.xz                 31-Aug-2024 18:59              191296
6.6.47-piCore-v7_System.map.xz                     31-Aug-2024 18:59              525128
6.6.47-piCore-v7l_.config                          31-Aug-2024 19:05              229656
6.6.47-piCore-v7l_Module.symvers.xz                31-Aug-2024 19:05              198488
6.6.47-piCore-v7l_System.map.xz                    31-Aug-2024 19:05              555792
6.6.47-piCore_.config                              31-Aug-2024 18:53              205318
6.6.47-piCore_Module.symvers.xz                    31-Aug-2024 18:53              188056
6.6.47-piCore_System.map.xz                        31-Aug-2024 18:53              505044

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version