LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to auto-load a custom module? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-auto-load-a-custom-module-730121/)

mcdimus 06-02-2009 07:03 AM

How to auto-load a custom module?
 
Hallo.

Sorry for my bad language skills, but hope you will understand. :)


I am using Ubuntu 9.04 on Thinkpad SL400 and I need to install lenovo-sl-laptop driver for hot-keys and back-light control.
Here is a short manual, which I have used: http://www.thinkwiki.org/wiki/SL_Driver_on_Ubuntu.

So it works perfectly when I manually insmod the module via "sudo insmod lenovo-sl-laptop.ko". But I would like it to load automatically. I did exactly the 5th step, although module does not load at startup. What is more I have noticed that the module "lenovo-sl-laptop.ko" disappeared from "volatile" folder after reboot.

I would be grateful, if somebody could tell me how to do the trick.

Thank you,

Dmitri.

rikxik 06-03-2009 12:57 AM

1. AGAIN verify that you are manually lsmod (to confirm if you have the original .ko files in right place). If not, you need to reinstall them. No need to move to volatile etc.
2. create a file /etc/modprobe.d/lenovo-sl-laptop.conf which just has one line: 'options lenovo-sl-laptop control_backlight=1' (this tells modprobe to load the module with backlight control enabled)
3. edit the /etc/modules file and add the line 'lenovo-sl-laptop' to the end
4. Reboot. If still not working, check /var/log/messages and /var/log/syslog

mcdimus 06-03-2009 03:36 PM

The module `lenovo-sl-laptop.ko` is in the folder on my desktop. And then I "cd" to this directory and "insmod lenovo-sl-laptop" - it works.

I have created a file /etc/modprobe.d/lenovo-sl-laptop.conf and have edited the /etc/modules file as well.

I have checked /var/log/messages and /var/log/syslog, there is no word about `lenovo-sl-laptop` after rebooting.

So it is still not auto-loading. :(

rikxik 06-04-2009 02:04 AM

I don't have access to a linux m/c now - you can try copying the .ko files to the usual place for modules (/usr/lib/ ??). After that, do insmod from a different directory, say, /tmp. If it picks up, then you should be ok.


All times are GMT -5. The time now is 07:26 PM.