In the fido release, kernel assembly handling has been changed. In previous releases, you can usually just skip to the use case below.
In fido , if you want the src core and build system to be available in the SDK, you must add
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
to your image recipe. This ensures that the new kernel-devsrc is installed in your toolchain.
The procedure below is intended only to ensure that the rest of the workflow is fully understood (although this is not strictly part of the original question).
Usage example
Let's assume the Makefile module is as follows:
obj-m += hello-1.o all: make -C $(KERNEL_SRC M=$(PWD) modules clean: make -C $(KERNEL_SRC) M=$(PWD) clean
Example taken from the Linux kernel module programming guide (note that there must be a tab character for indentation for actual commands).
Then you need to define KERNEL_SRC as sysroots/<mach>/usr/src/kernel/ , either in the Makefile or from your call request. (Using a variable of type KERNEL_SRC ensures that your module recipe automatically selects the right place when creating using the beatbox).
To manually create a kernel module:
- Extract the environment file - * for your SDK.
- Go to the modules directory.
KERNEL_SRC=<sdk-install-path>/sysroots/<mach>/usr/src/kernel LDFLAGS="" make However, this will fail because fixdep cannot be found. We will fix it manually.cd <sdk-install-path>/sysroots/<mach>/usr/src/kernelmake silentoldconfig scripts
If you need to run this using sudo, be sure to send the environment file to the sudo environment: sudo bash -c "source <sdk-install-path>/environment-setup-<mach> && make silentoldconfig sripts"
- Return to your modules directory.
KERNEL_SRC=<sdk-install-path>/sysroots/<mach>/usr/src/kernel LDFLAGS="" make
Now it will allow you to create your own modules.
If you do not have a kernel source under ysroots/<mach>/usr/src/kernel/ , we will need to study this.
source share