LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2013, 06:58 AM   #1
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Rep: Reputation: 16
Custom kernel module on start-up


Hello experts,

I have a custom kernel module foo.ko that I want to be loaded when the system boots. I know that I can move it to /lib/modules/`uname -r`/...., add entry inside /etc/modules and it will work.

However, my requirement is bit different: I want to load it from a different directory. How can I tell modprobe to look into the /mypath/lib/modules directory instead of /lib/modules?

Additionally I want to perform some additional tasks such as using mknod to create some files in /dev.

I can do all this with an init.d script but I believe there's a better way out there.

Please help. Thanks for your time.

Version: Ubuntu 10.04 LTS Server edition
 
Old 01-21-2013, 04:11 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use insmod to load a module from a directory other than /lib/modules/`uname -r".
Code:
insmod /mypath/lib/modules/mymodule.ko
For the rest I don't know, but usually it's the module that creates a special device in /dev

Regards
 
Old 01-21-2013, 09:05 PM   #3
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Original Poster
Rep: Reputation: 16
Thanks for the reply bathory!! I know I can use insmod, but that'd be like using a script to execute on start-up.

There would be some configuration that tells modprobe to look into /lib/modules/xxx. I wanted to explore that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
change the module and create custom kernel cccc Debian 9 05-30-2011 10:46 AM
[SOLVED] nvidia kernel module with custom kernel feech Linux - Kernel 2 01-26-2010 01:25 PM
Trying to build custom ipw2200 kernel module jff24grd Linux - Newbie 1 11-02-2009 02:56 PM
Custom Kernel: Cannot install ndiswrapper module lebabyg Mandriva 7 12-16-2006 08:00 PM
Custom 2.6.10 kernel, how can I tell which NIC module I'm using? lowpro2k3 Slackware 2 01-10-2005 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration