Problem of adding an external out-of-tree Linux kernel module↑
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-30 11:17 PM - edited 2025-03-30 11:21 PM
Hi,
I'm trying to add external out-of-tree module in developer package. (following wiki)
After following wiki, I got error message in board(STM32MP157F-DK2) like this.
modprobe: ERROR: could not insert 'kernel_module_example': Exec format error
There was a difference with wiki while proceeding according to wiki's explanation.
- In wiki, the "kernel_module_example.ko" is generated in [install_artifact/lib/modules/"<kernel version>"/extra/].
- But, my .ko file is generated in [install_artifact/lib/modules/"<kernel version>"/updates/]
Is there anything else I need to do to add external out-of-tree module?
- Ubuntu version (PC) : ubuntu 20.04 lts
- Board : STM32MP157F-DK2
- source code version : 24.11.06 (stm32mp1-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06)
Thanks.
Regards,
Youngjun.
Solved! Go to Solution.
- Labels:
-
OpenSTLinux
-
STM32MP15 Lines
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-30 11:51 PM - edited 2025-03-30 11:51 PM
Hello @Younjun ,
The update folder is the one by default now instead of extra. The location of your module installation folder is good so.
Did you well sourced your SDK before compilation ? If you make "file <your_module>" do you well see this is ARM32 format ?
Last thing to check, did you well reinstall your Linux kernel Image as the magic number version changed by recompiling the kernel, so you need to redeploy the Boot Image kernel part as well as all the other modules.
Kind regards,
Erwan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-30 11:51 PM - edited 2025-03-30 11:51 PM
Hello @Younjun ,
The update folder is the one by default now instead of extra. The location of your module installation folder is good so.
Did you well sourced your SDK before compilation ? If you make "file <your_module>" do you well see this is ARM32 format ?
Last thing to check, did you well reinstall your Linux kernel Image as the magic number version changed by recompiling the kernel, so you need to redeploy the Boot Image kernel part as well as all the other modules.
Kind regards,
Erwan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-31 12:54 AM
Hello Erwan.
Thank you for replying.
I sourced SDK before complication.
I am not familiar with the embedded Linux environment, so I ask the following basic questions
- How can i check my module file is ARM32 format?
- I just following this wiki(Adding an external out-of-tree Linux kernel module).
In wiki, there is only a description that runs depmod and sync after transferring the external out-of-tree module to the board.
If so, should I proceed as below for the distribution of external out-of-tree modules?- generate module file (kernel_module_example.ko)
- recompiling the kernel
- redeploy kernel
- run depmod and sync
Is there any documents about external out-of-tree module with recompiling the kernel?
Thansk.
Kind regards,
Youngjun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-31 11:23 PM
I resolved the problem.
The problem was path setting.
I set the KERNEL_SRC_PATH to another folder.
And, below process in wiki is working.
Thanks.
