how to compile kernel module using yocto sdk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to compile kernel module using yocto sdk

4,059 Views
hyoungkikim
Contributor III

hi

i am not good at English 

i have a problem with compiling  a kernel module 

a board is imx6sx evk and kernel is 5.10.35 , yocto is hardknott ( is right ? i installed with this command  : repo init -u https://source.codeaurora.org/external/imx/imx-manifest
-b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml )

i make SDK form core-image-full_cmdline image   and installed  and  compiled kernel and modules ( in kernel directroy) ,a test program  without problems

but when i compile a module which is not in kernel directory

no module.ko file made  

the module source is fine  ( i copy a source into kernel/driver and make modules ,,it works fine)

and i compiled previous yocto SDK  with success 

any tips and ideas will be appreciated . thank in advance 

 

 

imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/
fsl-imx-wayland/ fsl-imx-xwayland/ VBoxGuestAdditions-5.2.32/
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-
fsl-imx-wayland/ fsl-imx-xwayland/
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-wayland/5.10-hardknott/
environment-setup-cortexa7t2hf-neon-poky-linux-gnueabi sysroots/
site-config-cortexa7t2hf-neon-poky-linux-gnueabi version-cortexa7t2hf-neon-poky-linux-gnueabi
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-wayland/5.10-hardknott/environment-setup-cortexa7t2hf-neon-poky-linux-gnueabi
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ make
make -C /home/imx6ull/work/Kernel/git.5.10.35 SUBDIRS=/media/sf_shared/example/gpio-irq/dev modules
make[1]: Entering directory '/home/imx6ull/work/imx-yocto-bsp/imx6ull/tmp/work-shared/imx6ull14x14evk/kernel-source'   --> i don't know why make goes into this directory which i made SDK
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
CHK include/generated/compile.h
make[1]: Leaving directory '/home/imx6ull/work/imx-yocto-bsp/imx6ull/tmp/work-shared/imx6ull14x14evk/kernel-source'
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ ls *.ko
ls: cannot access '*.ko': No such file or directory
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$

and my makefile 

obj-m := of-test.o

KDIR := /home/imx6ull/work/Kernel/git.5.10.35
PWD := $(shell pwd)
NFS_ROOT = /home/imx6ull/work/imx-yocto-bsp/imx6sx/nfs_full/home/root

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
# cp of-test.ko $(NFS_ROOT)/

clean:
rm -rf *.ko
rm -rf *.mod.*
rm -rf .*.cmd
m -rf *.o

 

 

0 Kudos
4 Replies

4,024 Views
hyoungkikim
Contributor III

thank  you  for help

0 Kudos

4,047 Views
hyoungkikim
Contributor III

thank you 

but  that needs yocto,  if i  deploy SDK , how other people  compile a module ?

i doubt that  it is only my problem ,   because  before  i  compiled kernel and modules by SDK  without  fail

 

0 Kudos

4,042 Views
igorpadykov
NXP Employee
NXP Employee

since this is general yocto question, recommended to post it on meta-fsl-arm mailing list

https://lists.yoctoproject.org/g/meta-freescale

 

Best regards
igor

0 Kudos

4,054 Views
igorpadykov
NXP Employee
NXP Employee

Hi Hyoung

 

one can look at below knowledge base article

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-Yocto-Project-How-can-I-quickly-mod...

 

Best regards
igor

0 Kudos