Skip to main content
NPal.2
Associate III
December 14, 2021
Solved

Building Kernel Modules

  • December 14, 2021
  • 3 replies
  • 4539 views

Hi,

I am currently trying to make some changes in the kernel form the latest openstlinux development package v3.1.0.

I have one query ; when we compile kernel modules are there still certian modules which do not get compiled?

I can see that after compilition I am getting an error for the vermagic for the galckore.ko which does not seem to get compiled with kernel.

Even if i have the CONFIG_MODEVERSIONS=y , still i seem to get vermagic error.

How do i get past this ?

Also how to re-compile this module?

This topic has been closed for replies.
Best answer by Kevin HUBER

Hello @NPal.2​ ,

The module galcore.ko is provided into the rootfs when the image is built from the distribution package. Which is the case of the starter package.

This module is provided already compiled and it is not compiled again by the linux of the developer package.

If you have set CONFIG_MODVERSIONS=y, you are able to use a module built for another kernel, which is the case here.

I think you encounter this error because you are using a starter package misaligned with the v3.1.0.

You have to use the Starter Package of the v3.1.0 to have the correct rootfs and the correct galcore.ko, to be used with the developer package v3.1.0.

Please follow this page to be sure to flash the Starter package v3.1.0 on your board: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image#Download_the_image

Then copy again your modified kernel on the board.

To verify if you use the right version of galcore.ko related to your kernel version, you can use these commands:

Check the kernel version:

root@stm32mp1:~# uname -a
Linux stm32mp1 5.10.61 #1 SMP PREEMPT Thu Aug 26 12:51:21 UTC 2021 armv7l armv7l armv7l GNU/Linux

Then check for which version of kernel the module is made:

root@stm32mp1:~# modinfo galcore
filename: /lib/modules/5.10.61/extra/galcore.ko
license: Dual MIT/GPL
description: Vivante Graphics Driver
alias: of:N*T*Cvivante,gcC*
alias: of:N*T*Cvivante,gc
alias: of:N*T*Cst,gcnanoC*
alias: of:N*T*Cst,gcnano
depends: 
name: galcore
vermagic: 5.10.61 SMP preempt mod_unload modversions ARMv7 p2v8

The kernel versions of the two commands must match.

Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

3 replies

Kevin HUBER
Kevin HUBERBest answer
Technical Moderator
December 15, 2021

Hello @NPal.2​ ,

The module galcore.ko is provided into the rootfs when the image is built from the distribution package. Which is the case of the starter package.

This module is provided already compiled and it is not compiled again by the linux of the developer package.

If you have set CONFIG_MODVERSIONS=y, you are able to use a module built for another kernel, which is the case here.

I think you encounter this error because you are using a starter package misaligned with the v3.1.0.

You have to use the Starter Package of the v3.1.0 to have the correct rootfs and the correct galcore.ko, to be used with the developer package v3.1.0.

Please follow this page to be sure to flash the Starter package v3.1.0 on your board: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image#Download_the_image

Then copy again your modified kernel on the board.

To verify if you use the right version of galcore.ko related to your kernel version, you can use these commands:

Check the kernel version:

root@stm32mp1:~# uname -a
Linux stm32mp1 5.10.61 #1 SMP PREEMPT Thu Aug 26 12:51:21 UTC 2021 armv7l armv7l armv7l GNU/Linux

Then check for which version of kernel the module is made:

root@stm32mp1:~# modinfo galcore
filename: /lib/modules/5.10.61/extra/galcore.ko
license: Dual MIT/GPL
description: Vivante Graphics Driver
alias: of:N*T*Cvivante,gcC*
alias: of:N*T*Cvivante,gc
alias: of:N*T*Cst,gcnanoC*
alias: of:N*T*Cst,gcnano
depends: 
name: galcore
vermagic: 5.10.61 SMP preempt mod_unload modversions ARMv7 p2v8

The kernel versions of the two commands must match.

Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

NPal.2
NPal.2Author
Associate III
December 22, 2021

HI @Kevin HUBER​ : Thanks a lot for the response. This solve my query.

mteaching
Associate III
April 20, 2022
root@stm32mp1:~# [ 38.778847] Time out check galcore device expired
[ 38.859620] Configure weston on pixman
[ 57.220735] ipv6: disagrees about version of symbol module_layout
[ 57.252771] ipv6: disagrees about version of symbol module_layout
[ 57.275599] ipv6: disagrees about version of symbol module_layout
[ 57.289619] ipv6: disagrees about version of symbol module_layout
[ 57.900615] ipv6: disagrees about version of symbol module_layout
[ 59.496528] cfg80211: disagrees about version of symbol module_layout
[ 61.031792] ipv6: disagrees about version of symbol module_layout
 
root@stm32mp1:~# modinfo galcore
filename: /lib/modules/5.10.61/extra/galcore.ko
license: Dual MIT/GPL
description: Vivante Graphics Driver
alias: of:N*T*Cvivante,gcC*
alias: of:N*T*Cvivante,gc
alias: of:N*T*Cst,gcnanoC*
alias: of:N*T*Cst,gcnano
depends:
name: galcore
vermagic: 5.10.61 SMP preempt mod_unload modversions ARMv7 p2v8
root@stm32mp1:~# uname -a
Linux stm32mp1 5.10.61 #1 SMP PREEMPT Tue Apr 19 18:42:33 PDT 2022 armv7l armv7l armv7l GNU/Linux
hciconfig -a
[ 726.972340] libaes: disagrees about version of symbol module_layout
Can't open HCI socket.: Address family not supported by protocol
hciconfig -a
[ 745.029383] libaes: disagrees about version of symbol module_layout
Can't open HCI socket.: Address family not supported by protocol

First of all, why is this happening to so many people?Could you please make it easy in next version?

I have followed this page to be sure to flash the Starter package v3.1.0 on my board: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image#Download_the_image

I did not make any changes to the kernel and just build it.

This problem has been bothering me for a year,please give me some help.

Here is the full log:

mteaching
Associate III
April 20, 2022
root@stm32mp1:~# [ 38.778847] Time out check galcore device expired
[ 38.859620] Configure weston on pixman
[ 57.220735] ipv6: disagrees about version of symbol module_layout
[ 57.252771] ipv6: disagrees about version of symbol module_layout
[ 57.275599] ipv6: disagrees about version of symbol module_layout
[ 57.289619] ipv6: disagrees about version of symbol module_layout
[ 57.900615] ipv6: disagrees about version of symbol module_layout
[ 59.496528] cfg80211: disagrees about version of symbol module_layout
[ 61.031792] ipv6: disagrees about version of symbol module_layout
 
root@stm32mp1:~# modinfo galcore
filename: /lib/modules/5.10.61/extra/galcore.ko
license: Dual MIT/GPL
description: Vivante Graphics Driver
alias: of:N*T*Cvivante,gcC*
alias: of:N*T*Cvivante,gc
alias: of:N*T*Cst,gcnanoC*
alias: of:N*T*Cst,gcnano
depends:
name: galcore
vermagic: 5.10.61 SMP preempt mod_unload modversions ARMv7 p2v8
root@stm32mp1:~# uname -a
Linux stm32mp1 5.10.61 #1 SMP PREEMPT Tue Apr 19 18:42:33 PDT 2022 armv7l armv7l armv7l GNU/Linux
hciconfig -a
[ 726.972340] libaes: disagrees about version of symbol module_layout
Can't open HCI socket.: Address family not supported by protocol
hciconfig -a
[ 745.029383] libaes: disagrees about version of symbol module_layout
Can't open HCI socket.: Address family not supported by protocol

First of all, why is this happening to so many people?Could you please make it easy in next version?

I have followed this page to be sure to flash the Starter package v3.1.0 on my board: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image#Download_the_image

I did not make any changes to the kernel and just build it.

This problem has been bothering me for a year,please give me some help.

Here is the full log:

Kevin HUBER
Technical Moderator
April 20, 2022

Hello @mteaching​ ,

Sorry for that, but we can't "make it easy" because its a security features of Linux that exists at least from 2015.

To have more information on this error, you can search on internet "disagrees about version of symbol module_layout".

To summarize, after each build of your linux, the module_layout version of your modules changes and you must always have the module layout version related to your uImage Kernel into the board.

The only way to avoid having this error is to copy the modules after each build, by following the procedure to Deploy the Linux Kernel on the board:

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Modify,_rebuild_and_reload_the_Linux%C2%AE_kernel#Deploy_the_Linux-C2-AE_kernel_on_the_board

For your case, the part 5.3 Push the kernel modules onto the board is the one that you must be sure to do.

Hope it helps,

Regards,

Kevin

mteaching
Associate III
April 21, 2022

Thank you for your professional and quick reply!

In fact, I did all the steps five months ago, including the one you said of course. Today I rebuilt the environment and repeated it, the result is almost the same. It takes me at least two hours to do all this.

As I said, othre drivers are OK but the weston desktop reboot on every boot.

The question "Time out check load galcore module expired" still exits.

Please refer to this discussion(https://community.st.com/s/question/0D53W00000JiZmuSAF/stm32mp157caa3-galcoreko),although my answer is set to be optimal, error is still there.

root@stm32mp1:~# modinfo galcore
filename: /lib/modules/5.10.61/extra/galcore.ko
license: Dual MIT/GPL
description: Vivante Graphics Driver
alias: of:N*T*Cvivante,gcC*
alias: of:N*T*Cvivante,gc
alias: of:N*T*Cst,gcnanoC*
alias: of:N*T*Cst,gcnano
root@stm32mp1:~# uname -a
Linux stm32mp1 5.10.61 #1 SMP PREEMPT Wed Apr 20 20:02:01 PDT 2022 armv7l armv7l armv7l GNU/Linux

Do you have any suggestions for these issues?

Here is the full log:

Thank you again.