I downloaded and built a module for my Exar serial port board. After booting up, if I go into the directory where my .ko file is sitting, and execute “sudo insmod xr17V35.ko”, it loads the module and off I go.
However, I need it to come up and load on its own without user intervention. So far, my googling has failed me on how to do this.
I’m using openSuse 11.4 and 12.1 to do this.
I’ve tried using modprobe (says it cannot find the module), tried copying it to the serial directory under /lib/modules/* (still can’t be found), tried putting the path to the module into sysconfig/kernel for modules_to_load_at_boot…still nothing.
On 10/11/2012 01:36 PM, rob g wrote:
>
> I downloaded and built a module for my Exar serial port board. After
> booting up, if I go into the directory where my .ko file is sitting, and
> execute “sudo insmod xr17V35.ko”, it loads the module and off I go.
>
> However, I need it to come up and load on its own without user
> intervention. So far, my googling has failed me on how to do this.
>
> I’m using openSuse 11.4 and 12.1 to do this.
>
> I’ve tried using modprobe (says it cannot find the module), tried
> copying it to the serial directory under /lib/modules/* (still can’t be
> found), tried putting the path to the module into sysconfig/kernel for
> modules_to_load_at_boot…still nothing.
After you copied the module into the /lib/modules tree, I think you forgot the
‘sudo /sbin/depmod -a’ step. That builds the tables needed for a module to be
loaded automatically. As you discovered, you cannot add a full path in the
modules loaded at boot.
Your other option would be to add an ‘/sbin/insmod <path_to_module>’ to
/etc/init.d/boot.local.
As a general note, use modprobe instead of insmod – modprobe can resolve dependencies, whereas insmod can’t
add the module to the /etc/modprobe.d/ local.conf file
modprobe is likely not working because you likely (just built the module and ) didn’t install the module … installing it should set it up in /lb/modules/<kernelversion>/modules.dep etc. (not sure if there is anywhere else, but don’t think so)
As a note, that is what I implied (or, at least, meant to imply) by installing the module … a good make (or whatever) build script will allow you to install (ie. following up the make step with a make install) it for you (i.e. doing the manually dirty work that lwfinger just described)
I tried both methods, and they worked flawlessly. Thank you so much. I’m amazed this simple and correct answer was nowhere else to be found on the web…
And thanks for the other replies with helpful info.
On 10/11/2012 02:06 PM, Tyler K wrote:
> - As a general note, use modprobe instead of insmod – modprobe can
> resolve dependencies, whereas insmod can’t
That is true as long as the depmod step has been dome.
> - add the module to the /etc/modprobe.d/ local.conf file
>
> - modprobe is likely not working because you likely (just built the
> module and ) didn’t install the module … installing it should set it
> up in /lb/modules/<kernelversion>/modules.dep etc. (not sure if there
> is anywhere else, but don’t think so)
This is good advice, but one always needs to make sure the make file is correct.