09-23-2015 07:07 AM
I just finished building a petalinux 2014.2 test project and I was able to get a custom library and kernel module into the rootfs and on the image with no issues.
I am noticing however, that I still have to load the kernel module manually using insmod. Is there a a config setting I missed to have the OS load the module at start up, or do I have to write an init.d script to perform the action.
Thanks.
10-13-2015 10:41 AM
Hi Vanmierlo,
I found the solution in this forum post:
Adding the line to the install sectionof the makefile in the moduleproject will load the kernel module at boot:
$(TARGETINST) -d -a "module_name" /etc/modules
09-23-2015 07:53 AM - edited 09-23-2015 07:54 AM
To have the PetaLinux build tools incorporate kernel modules, follow this general flow:
For PetaLinux 2013.10 and later:
{{{
APP=myapp
all:
clean:
install: $(APP)
$(TARGETINST) -d $(APP)-prebuilt /bin/$(APP) }}}
For PetaLinux 2013.04 and earlier:
Build-time Compiled Modules
Pre-built Kernel Modules
Ensure that the kernel modules have been compiled for your PetaLinux target architecture (e.g., MicroBlaze, ARM, etc.).
An example of the modifications is as follows:
{{{
APP=myapp
all:
clean:
romfs:
$(ROMFSINST) -d $(APP) /lib/modules/<KERNELRELEASE>/extra/
}}}
10-13-2015 08:46 AM
Maybe I don't understand too well, but this answer tells how to add a kernel module to the rootfs, but not how to auto-load it at startup.
10-13-2015 10:41 AM
Hi Vanmierlo,
I found the solution in this forum post:
Adding the line to the install sectionof the makefile in the moduleproject will load the kernel module at boot:
$(TARGETINST) -d -a "module_name" /etc/modules