WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How can I symlink to the kernel source in "/lib/modules/'uname -a'/build"?  (Read 8017 times)

Offline danny

  • Jr. Member
  • **
  • Posts: 73
Hi
I want to symlink to the kernel source in "/lib/modules/'uname -a'/build".
But there is not "/usr/src/linux-headers-XXX/" directory on piCore11.X.
How can I produce file "/lib/modules/'uname -a'/build"?

Thanks

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
If you wish to compile kernel modules, you often need to symlink "/lib/modules/'uname -r'/build" to the unpacked and prepared kernel source.

For example, if you unpacked your kernel source at /usr/src/linux-rpi-4.19.81, then you would do this:
Code: [Select]
$ sudo ln -s /usr/src/linux-rpi-4.19.81 /lib/modules/4.19.81-piCore-v7l/build

Offline danny

  • Jr. Member
  • **
  • Posts: 73
I got the following message.
Code: [Select]
ln: /lib/modules/4.19.81-piCore-v7l/build: No such file or directory
Thanks

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
It looks like you either miss-typed the command or you did not create /usr/src/linux-rpi-4.19.81?

Offline danny

  • Jr. Member
  • **
  • Posts: 73
How can I create /usr/src/linux-rpi-4.19.81?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11283
Hi danny
This should do it:
Code: [Select]
sudo su
mkdir /usr/src
cd /usr/src
wget http://www.tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/linux-rpi-4.19.81.tar.xz
tar Jxvf linux-rpi-4.19.81.tar.xz
exit

Are you trying to build a kernel module? There are a lot more pre-compiled modules available in  modules.tar.gz  found here:
http://www.tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/

Offline danny

  • Jr. Member
  • **
  • Posts: 73
The file in linux-rpi-4.19.81.tar.xz is too large to unzip to /usr/src.
It is only 833MB available /usr/src.
So I unzip it to /mnt/mmcblk0p3/linux-rpi-4.19.81 and execute the following:
Code: [Select]
sudo ln -s /mnt/mmcblk0p3/linux-rpi-4.19.81 /lib/modules/4.19.81-piCore-v7/buildBut my wifi driver still can't identify kernel.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
Please paste the error message here.

Offline danny

  • Jr. Member
  • **
  • Posts: 73
The message is:
Code: [Select]
insmod: can't insert 'onebox_common_gpl.ko': invalid module format
insmod: can't insert 'wlan.ko': invalid module format
insmod: can't insert 'wlan_wep.ko': invalid module format
insmod: can't insert 'wlan_tkip.ko': invalid module format
insmod: can't insert 'wlan_ccmp.ko': invalid module format
insmod: can't insert 'wlan_aes_cmac.ko': invalid module format
insmod: can't insert 'wlan_acl.ko': invalid module format
insmod: can't insert 'wlan_xauth.ko': invalid module format
insmod: can't insert 'wlan_scan_sta.ko': invalid module format
insmod: can't insert 'onebox_wlan_nongpl.ko': invalid module format
insmod: can't insert 'onebox_wlan_gpl.ko': invalid module format
insmod: can't insert 'onebox_nongpl.ko': invalid module format
insmod: can't insert 'onebox_gpl.ko': invalid module format
cat: can't open '/proc/rpine0/stats': No such file or directory
Exiting: Driver init is not yet completed, Please check the coex mode / protocol selected

I want to use wifi module RYWDB00 on piCore.
I have used it successfully on Raspbian.
RYWDB00 support Kernel versions from 2.6.38 to 5.1.6.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
Kernel drivers taken from raspbian will not work on piCore.

You need the symlink to compile an out of tree driver, not use it.

Offline danny

  • Jr. Member
  • **
  • Posts: 73
Does it mean compile file in linux-rpi-4.19.81.tar.gz and let /lib/modules/4.19.81-piCore-v7/build symlink to it?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
No - I presume the driver source code for the RYWDB00 is not available in the linux kernel source.

If the above is true, then you need to obtain the source code for the RYWDB00 driver.

Once you have the source code for the driver you need to compile it against the prepared piCore kernel source.

Offline danny

  • Jr. Member
  • **
  • Posts: 73
OK,it sounds difficult.
I have obtained the source code of driver.
But I have no idea to make it compile it against the prepared piCore kernel source.
Could you provide any advice?
Thank you so much!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
The first problem is to find the kernel config for piCore-11beta - I don't have it  :(

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1100
grab configs.ko from the complete modules pack,

modprobe configs.ko
zcat /proc/config.gz