Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: danny on May 04, 2020, 08:30:42 PM
-
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
-
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: $ sudo ln -s /usr/src/linux-rpi-4.19.81 /lib/modules/4.19.81-piCore-v7l/build
-
I got the following message.
ln: /lib/modules/4.19.81-piCore-v7l/build: No such file or directory
Thanks
-
It looks like you either miss-typed the command or you did not create /usr/src/linux-rpi-4.19.81?
-
How can I create /usr/src/linux-rpi-4.19.81?
-
Hi danny
This should do it:
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/
-
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:
sudo ln -s /mnt/mmcblk0p3/linux-rpi-4.19.81 /lib/modules/4.19.81-piCore-v7/build
But my wifi driver still can't identify kernel.
-
Please paste the error message here.
-
The message is:
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.
-
Kernel drivers taken from raspbian will not work on piCore.
You need the symlink to compile an out of tree driver, not use it.
-
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?
-
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.
-
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!
-
The first problem is to find the kernel config for piCore-11beta - I don't have it :(
-
grab configs.ko from the complete modules pack,
modprobe configs.ko
zcat /proc/config.gz
-
Hi Paul,
Thanks for your help.
I pasted in terminal:
modprobe configs.ko
zcat /proc/config.gz
And then I see Linux/arm 4.19.81 Kernel Configuration.
What is the next step I can compile driver source code against the prepared piCore kernel source?
-
I learnt something there :)
Once you have the kernel config, to prepare the kernel source you need to do something like this using:
http://tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/linux-rpi-4.19.81.tar.xz
http://tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/Module.symvers
$ tce-load -i compiletc bash bc perl5 ncurses-dev openssl-dev libelf-dev
$ tar xf linux-rpi-4.19.81.tar.xz
$ cd linux-rpi-4.19.81
$ make mrproper
$ cp ../config-4.19.81-piCore-v7 .config
$ make oldconfig
$ make prepare
$ make modules_prepare
$ cp ../Module.symvers ./
$ make SUBDIRS=scripts/mod
.and the kernel source will be ready to compile your RYWDB00 source against it.
-
I met some problem:
1.Where is the directory of config-4.19.81-piCore-v7 and the file of .config?
2.Does the file of Module.symvers exist on piCore or I need to download it?
-
config-4.19.81-piCore-v7 is the piCore kernel config file as revealed by @Paul_123.
The config has been uploaded to the server here: http://tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/config-4.19.81-piCore-v7
Once you have downloaded the config file config-4.19.81-piCore-v7, you need to copy it into the kernel source and rename it to .config as explained previously.
As mentioned earlier, you need to download the Module.symvers file from here: http://tinycorelinux.net/11.x/armv7/releases/RPi/src/kernel/Module.symvers
-
Does it exist iw phy | greg phy command on piCore?
When I pasted iw phy | greg phy I got
-sh: iw: not found
-sh: greg: not found
-
The command is "grep" and not "greg".
There is no iw extension in piCore-11.x - use wireless_tools or, better still, wifi.
-
How can I use wireless_tools to find usable wifi interface?
Like:
iw phy | grep phy
-
$ iwconfig
-
This list when I execute "iwconfig"
wlan0 IEEE 802.11 ESSID:"MIT_5G"
Mode:Managed Frequency:5.22 GHz Access Point: 68:FF:7B:1A:43:CF
Bit Rate=433.3 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-34 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:8 Invalid misc:0 Missed beacon:0
eth0 no wireless extensions.
rpine0 no wireless extensions.
lo no wireless extensions.
I want to use "rpine0" be default wifi interface.
-
Have you tried:
$ sudo iwconfig wlan0 down
$ sudo iwconfig rpine0 up
-
It show:
iwconfig: unknown command "down"
iwconfig: unknown command "up"
-
Sorry - I meant ifconfig...
-
Can I use the following resource to install libnl and wi on piCore?
https://www.infradead.org/~tgr/libnl/files/
https://mirrors.edge.kernel.org/pub/software/network/iw/
-
Hi danny
The info files from previous versions list where the sources were downloaded from:
http://tinycorelinux.net/10.x/armv7/tcz/libnl.tcz.info
http://tinycorelinux.net/10.x/armv7/tcz/iw.tcz.info
There are some build scripts for libnl and iw here:
http://tinycorelinux.net/10.x/armv7/tcz/src/libnl/
http://tinycorelinux.net/10.x/armv7/tcz/src/iw/
-
libnl is in piCore-11.x and iw is provided by wireless-tools, which is also in piCore-11.x
-
Should I execute
./configure --host=arm-linux --prefix=/home/tc/work
and compile Makefile in iw-4.14 and libnl-3.4.0 like
make mrproper
or other instruction to compile them?
-
You should do it like this:
CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --disable-static
find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
make
sudo make install
..but why compile them when they already exist?
-
When I pasted
CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --disable-static
then show
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether make supports nested variables... (cached) no
checking for style of include used by make... none
checking for gcc... gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe
checking whether the C compiler works... no
configure: error: in `/home/tc/libnl-3.4.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
-
Did you load compiletc and are you compiling on an RPi?
-
Thanks for help Juanito and Rich.
I have installed it successfully.
By the way,
Can I change default Wifi interface "wlan0" to another one on piCore?
-
What are you try to do exactly?
If you wish to disable the built-in wifi on an RPi3, for example, you can add the following to /mnt/mmcblk0p1/config.txt: dtoverlay=pi3-disable-wifi
Once the built-in wifi is disabled, the wifi.sh script from the wifi extension looks like it would detect rpine0 from your extenal adapter.
Edit: it also looks like "dtoverlay=disable-wifi" would disable the built-in wifi on both RPi3 and RPi4.