OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> compiling modules, kernel module compiled doesn't match the boot kernel ( solved )
cam1965
post Feb 18 2020, 08:14 AM
Post #1





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



Hi , I am trying to compile some modules from kernel ( available at github ) . But when I did the command : modprobe " some module" it gave me an error something about exec format. ( because the kernel module compiled doesn't match the boot kernel ). I've also tried the kernel and kernel-headers from repository ( using apt-get install ) but in this case the Fn key doesn't work and also no module was loaded ( wifi also didn't work ). So what is the kernel source repository that matches the kernel boot ?
Note : I've tried all branches from the kernel available at github .
Thank you all.
Go to the top of the page
 
+Quote Post
mithrandir
post Feb 18 2020, 01:47 PM
Post #2





Group: Members
Posts: 171
Joined: 7-January 18
Member No.: 815,997



QUOTE(cam1965 @ Feb 18 2020, 08:14 AM) *
Hi , I am trying to compile some modules from kernel ( available at github ) . But when I did the command : modprobe " some module" it gave me an error something about exec format. ( because the kernel module compiled doesn't match the boot kernel ). I've also tried the kernel and kernel-headers from repository ( using apt-get install ) but in this case the Fn key doesn't work and also no module was loaded ( wifi also didn't work ). So what is the kernel source repository that matches the kernel boot ?
Note : I've tried all branches from the kernel available at github .
Thank you all.

Just guessing, had no time to try out the Linux image, yet.
Maybe the compiler does not match the one used to compile the kernel. Had the same problem when compiling android modules.

Which compiler did you use? gcc? What is the output of cat /proc/version ?
Just to be sure, what is the version of the kernel packages?

If I am right with my guess, either use the matching compiler, probably clang, or create an own boot image. (boot image and modules compiled with same compiler).
Go to the top of the page
 
+Quote Post
cam1965
post Feb 18 2020, 02:43 PM
Post #3





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



QUOTE(mithrandir @ Feb 18 2020, 01:47 PM) *
QUOTE(cam1965 @ Feb 18 2020, 08:14 AM) *
Hi , I am trying to compile some modules from kernel ( available at github ) . But when I did the command : modprobe " some module" it gave me an error something about exec format. ( because the kernel module compiled doesn't match the boot kernel ). I've also tried the kernel and kernel-headers from repository ( using apt-get install ) but in this case the Fn key doesn't work and also no module was loaded ( wifi also didn't work ). So what is the kernel source repository that matches the kernel boot ?
Note : I've tried all branches from the kernel available at github .
Thank you all.

Just guessing, had no time to try out the Linux image, yet.
Maybe the compiler does not match the one used to compile the kernel. Had the same problem when compiling android modules.

Which compiler did you use? gcc? What is the output of cat /proc/version ?
Just to be sure, what is the version of the kernel packages?

If I am right with my guess, either use the matching compiler, probably clang, or create an own boot image. (boot image and modules compiled with same compiler).


The modules were compiled successfully. The problem is when I will load them.
The compiler is gcc . I' ve compiled inside debian in cosmo communicator.
I am using the sources from https://github.com/gemian/cosmo-linux-kernel-4.4
Note : I 've compiled only the modules.
The boot kernel is from the image provided in planet support page. ( http://support.planetcom.co.uk/index.php/Cosmo_Linux_Beta )

gemini@cosmopda:~$ cat /proc/version
Linux version 4.4.146 (nekit@supernova) (Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)) #28 SMP PREEMPT Sat Jan 18 22:23:37 GMT 2020
gemini@cosmopda:~$


thank you.
Go to the top of the page
 
+Quote Post
mithrandir
post Feb 18 2020, 03:35 PM
Post #4





Group: Members
Posts: 171
Joined: 7-January 18
Member No.: 815,997



QUOTE(cam1965 @ Feb 18 2020, 02:43 PM) *
gemini@cosmopda:~$ cat /proc/version
Linux version 4.4.146 (nekit@supernova) (Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)) #28 SMP PREEMPT Sat Jan 18 22:23:37 GMT 2020
gemini@cosmopda:~$


thank you.


OK, that's it. From your output, the kernel has been compiled using clang. So install a clang compiler as near as possible to clang version 6.0.2. Command line should be similar to the one I have been using for the Android modules: https://www.mygnu.de/2020/02/exfat-support-...o-communicator/

First I also have tried with gcc and got the same exec format error on Android.

Another aproach would be to compile kernel and modules with gcc. For the Gemini this involved a mkbootimg step ( @see: https://github.com/gemian/gemini-keyboard-a...rnelCompilation ) to get a bootable image. I don't know if this also applies to the Cosmo and how to do it, yet.
Go to the top of the page
 
+Quote Post
cam1965
post Feb 18 2020, 03:46 PM
Post #5





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



QUOTE(mithrandir @ Feb 18 2020, 03:35 PM) *
QUOTE(cam1965 @ Feb 18 2020, 02:43 PM) *
gemini@cosmopda:~$ cat /proc/version
Linux version 4.4.146 (nekit@supernova) (Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)) #28 SMP PREEMPT Sat Jan 18 22:23:37 GMT 2020
gemini@cosmopda:~$


thank you.


OK, that's it. From your output, the kernel has been compiled using clang. So install a clang compiler as near as possible to clang version 6.0.2. Command line should be similar to the one I have been using for the Android modules: https://www.mygnu.de/2020/02/exfat-support-...o-communicator/

First I also have tried with gcc and got the same exec format error on Android.

Another aproach would be to compile kernel and modules with gcc. For the Gemini this involved a mkbootimg step ( @see: https://github.com/gemian/gemini-keyboard-a...rnelCompilation ) to get a bootable image. I don't know if this also applies to the Cosmo and how to do it, yet.


OK. Thank you so much again.
Go to the top of the page
 
+Quote Post
cam1965
post Feb 19 2020, 08:23 AM
Post #6





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



QUOTE(cam1965 @ Feb 18 2020, 03:46 PM) *
QUOTE(mithrandir @ Feb 18 2020, 03:35 PM) *
QUOTE(cam1965 @ Feb 18 2020, 02:43 PM) *
gemini@cosmopda:~$ cat /proc/version
Linux version 4.4.146 (nekit@supernova) (Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)) #28 SMP PREEMPT Sat Jan 18 22:23:37 GMT 2020
gemini@cosmopda:~$


thank you.


OK, that's it. From your output, the kernel has been compiled using clang. So install a clang compiler as near as possible to clang version 6.0.2. Command line should be similar to the one I have been using for the Android modules: https://www.mygnu.de/2020/02/exfat-support-...o-communicator/

First I also have tried with gcc and got the same exec format error on Android.

Another aproach would be to compile kernel and modules with gcc. For the Gemini this involved a mkbootimg step ( @see: https://github.com/gemian/gemini-keyboard-a...rnelCompilation ) to get a bootable image. I don't know if this also applies to the Cosmo and how to do it, yet.


OK. Thank you so much again.


I've compiled with clang. But when loading the module I've got the same error.
Maybe in the future I will try to compile the kernel and modules with gcc.
Thank you so much again.
Go to the top of the page
 
+Quote Post
mithrandir
post Feb 19 2020, 01:23 PM
Post #7





Group: Members
Posts: 171
Joined: 7-January 18
Member No.: 815,997



QUOTE(cam1965 @ Feb 19 2020, 08:23 AM) *
I've compiled with clang. But when loading the module I've got the same error.
Maybe in the future I will try to compile the kernel and modules with gcc.
Thank you so much again.

Have you tried to read the running kernels configuration (cat /proc|config.gz|gunzip>.config) and use this as a base for your kernel configuration? Another possible cause could be compiling from git head. Maybe there have been commits relevant for the module layout after the kernel has been built.
Go to the top of the page
 
+Quote Post
cam1965
post Feb 19 2020, 03:47 PM
Post #8





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



QUOTE(mithrandir @ Feb 19 2020, 01:23 PM) *
QUOTE(cam1965 @ Feb 19 2020, 08:23 AM) *
I've compiled with clang. But when loading the module I've got the same error.
Maybe in the future I will try to compile the kernel and modules with gcc.
Thank you so much again.

Have you tried to read the running kernels configuration (cat /proc|config.gz|gunzip>.config) and use this as a base for your kernel configuration? Another possible cause could be compiling from git head. Maybe there have been commits relevant for the module layout after the kernel has been built.


Yes, I am using this config from /proc/config.gz. And I ´ve tried all branches available ( master, native and packaging ).
Note : This config file has only 2 modules after the compiling process. This is good for test purposes. It takes a very litle time to compile.

Thank you so much again.
Go to the top of the page
 
+Quote Post
shuntcap
post Mar 12 2020, 01:30 AM
Post #9





Group: Members
Posts: 37
Joined: 10-January 10
From: Roseboom, NY, USA
Member No.: 59,214



QUOTE(cam1965 @ Feb 19 2020, 06:47 PM) *
QUOTE(mithrandir @ Feb 19 2020, 01:23 PM) *
QUOTE(cam1965 @ Feb 19 2020, 08:23 AM) *
I've compiled with clang. But when loading the module I've got the same error.
Maybe in the future I will try to compile the kernel and modules with gcc.
Thank you so much again.

Have you tried to read the running kernels configuration (cat /proc|config.gz|gunzip>.config) and use this as a base for your kernel configuration? Another possible cause could be compiling from git head. Maybe there have been commits relevant for the module layout after the kernel has been built.


Yes, I am using this config from /proc/config.gz. And I ´ve tried all branches available ( master, native and packaging ).
Note : This config file has only 2 modules after the compiling process. This is good for test purposes. It takes a very litle time to compile.

Thank you so much again.

See my post here regarding reconfiguring the kernel to allow force-loading of modules, then force-loading the wifi module.
Go to the top of the page
 
+Quote Post
cam1965
post Mar 12 2020, 08:02 AM
Post #10





Group: Members
Posts: 142
Joined: 28-May 19
Member No.: 848,911



QUOTE(shuntcap @ Mar 12 2020, 01:30 AM) *
QUOTE(cam1965 @ Feb 19 2020, 06:47 PM) *
QUOTE(mithrandir @ Feb 19 2020, 01:23 PM) *
QUOTE(cam1965 @ Feb 19 2020, 08:23 AM) *
I've compiled with clang. But when loading the module I've got the same error.
Maybe in the future I will try to compile the kernel and modules with gcc.
Thank you so much again.

Have you tried to read the running kernels configuration (cat /proc|config.gz|gunzip>.config) and use this as a base for your kernel configuration? Another possible cause could be compiling from git head. Maybe there have been commits relevant for the module layout after the kernel has been built.


Yes, I am using this config from /proc/config.gz. And I ´ve tried all branches available ( master, native and packaging ).
Note : This config file has only 2 modules after the compiling process. This is good for test purposes. It takes a very litle time to compile.

Thank you so much again.

See my post here regarding reconfiguring the kernel to allow force-loading of modules, then force-loading the wifi module.


Thank you so much again.
I've just answered you there. Worked like a charm !
Thank you again !
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 7th April 2020 - 10:13 AM