I created a custom and simple module named Hello.ko I install the module with the command "insmod hello.ko", I check it with "dmesg" and it's working, but when I restart the system, I have to load it manually. So, how can I do for loading my custom module automatically, and where do I have to put the hello.ko? After loading the module, I would like to show the message Hello World until I press the Enter Key. Can anybody help me?
Linux config file to load a kernel module You need to edit the file named /etc/modules or put a new config file in /etc/modules-load. d/ directory. Use any one of the methods for loading kernel modules. The configuration file consists of a set of lines.
This technique didn't work on Ubuntu 13.10. So after a few trial and error tries I ended up with this:
Copy my kernel module to the drivers directory.
$ sudo cp mymodule.ko /lib/modules/$(uname -r)/kernel/drivers/
Add the simple name of my module to the file /etc/modules. You can edit the file or just append to it as shown here.
$ echo 'mymodule' | sudo tee -a /etc/modules
Update the list of module dependencies.
$ sudo depmod
Reboot the computer and voila, it worked.
Add the module to the /etc/modules file.
And then put the module in your /lib/modules/kernelname catalogue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With