WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: invalid module format issue with piCore 8.0 on Raspberry pi3  (Read 3184 times)

Offline larryle

  • Newbie
  • *
  • Posts: 8
invalid module format issue with piCore 8.0 on Raspberry pi3
« on: September 27, 2016, 02:16:21 AM »
Hi ALL

I download piCore 8.0 to s new sd card and then  i run following command after sudo su:

mkdir /mnt/mmcblk0p2/src
mkdir /mnt/mmcblk0p2/src/tmp

 cd /mnt/mmcblk0p2/src
 wget http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.20_RaspberryPi_src.tar.xz -P /mnt/mmcblk0p2/src
 wget http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.20-piCore+.config.xz  -P /mnt/mmcblk0p2/src
 unxz 4.4.20_RaspberryPi_src.tar.xz
 tar -xvf 4.4.20_RaspberryPi_src.tar
 unxz 4.4.20-piCore+.config.xz
 cp 4.4.20-piCore\+.config ./4.4.20/.config
 cd 4.4.20/
make modules
#install
sudo make INSTALL_MOD_PATH=/mnt/mmcblk0p2/src/tmp modules_install firmware_install
cd /mnt/mmcblk0p2/src/tmp/

sudo insmod /mnt/mmcblk0p2/src/tmp/lib/modules/4.4.20-piCore/kernel/drivers/net/ppp/ppp_generic.ko

I got his error:
insmod: can't insert '/mnt/mmcblk0p2/src/tmp/lib/modules/4.4.20-piCore/kernel/drivers/net/ppp/ppp_generic.ko': invalid module format


then I run this command to get the module version info
modinfo -Fvermagic  /mnt/mmcblk0p2/src/tmp/lib/modules/4.4.20-piCore/kernel/drivers/net/ppp/ppp_generic.ko

here is what I got:
--------------------------------
vermagic:       4.4.20-piCore mod_unload modversions ARMv6
-------------------------------------------------------------------------------------


Then I looked an existing module version
modinfo -Fvermagic /lib/modules/4.4.20-piCore_v7+/kernel/drivers/i2c/i2c-dev.ko.gz
What I got was:
-------------------------------------------------------------------------------------
vermagic:       4.4.20-piCore_v7+ SMP mod_unload modversions ARMv7
-------------------------------------------------------------------------------------

which means, exisitng module had different vermagic info, that's why I cannot install a compiled module even on same PI3.
I don't have this issue on piCore 7.x
So my question is, how to compile modules with vermaigc as same as existing modules?

Can anybody pls help?


tks
Larry






Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 709
Re: invalid module format issue with piCore 8.0 on Raspberry pi3
« Reply #1 on: September 27, 2016, 03:21:02 AM »
Have you seen that you have two directorys one for arm6 and one for arm7.

http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/

Raspberry Pi 3 is arm7.


Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1243
Re: invalid module format issue with piCore 8.0 on Raspberry pi3
« Reply #2 on: September 27, 2016, 05:20:44 PM »
You also need to download the Modules.symvers, System.map

extract that in to kernel root directory.....make changes to the .config if you need to.   Then build the new module.

Offline larryle

  • Newbie
  • *
  • Posts: 8
Re: invalid module format issue with piCore 8.0 on Raspberry pi3
« Reply #3 on: September 27, 2016, 09:19:57 PM »
Have you seen that you have two directorys one for arm6 and one for arm7.

http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/

Raspberry Pi 3 is arm7.

just download piCore 8 from http://tinycorelinux.net/ports.html and then click Raspberry Pi and it guid me to http://tinycorelinux.net/8.x/armv6/

Bit confused. is that means PI3 p2 cannot use same SD card?   I am developing a product which hoping just one sd card can use on Pi3 P2 P1+B
. NOT possibile?

tks
Larry


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: invalid module format issue with piCore 8.0 on Raspberry pi3
« Reply #4 on: September 28, 2016, 01:46:06 AM »
just download piCore 8 from http://tinycorelinux.net/ports.html and then click Raspberry Pi and it guid me to http://tinycorelinux.net/8.x/armv6/

Bit confused. is that means PI3 p2 cannot use same SD card?   I am developing a product which hoping just one sd card can use on Pi3 P2 P1+B
. NOT possibile?

tks
Larry

SD card image for armv6 armv7 is the same, there is only one piCore-8.0 image.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tatemono

  • Newbie
  • *
  • Posts: 18
Re: invalid module format issue with piCore 8.0 on Raspberry pi3
« Reply #5 on: December 17, 2016, 11:20:31 AM »
Have you seen that you have two directorys one for arm6 and one for arm7.

http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/

Raspberry Pi 3 is arm7.

just download piCore 8 from http://tinycorelinux.net/ports.html and then click Raspberry Pi and it guid me to http://tinycorelinux.net/8.x/armv6/

Bit confused. is that means PI3 p2 cannot use same SD card?   I am developing a product which hoping just one sd card can use on Pi3 P2 P1+B
. NOT possibile?

tks
Larry

@Larry:

It is not necessary for you to compile kernel source code to get ppp_generic.ko for your RPi3. You can download a XZ-compressed tar file containing all kernel driver modules for RPi3, including ppp_generic.ko.
Please visit "http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/" as mentioned by patrikg. Then download "4.4.20-piCore_v7+_modules.tar.xz" and decompress it. The kernel driver module your RPi3 needs is "modules/4.4.20-piCore_v7+/kernel/drivers/net/ppp/ppp_generic.ko". Of course, the vermagic of such ppp_generic.ko is "4.4.20-piCore_v7+ SMP mod_unload modversions ARMv".