Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-16-2011, 05:44 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Link module statically or make an independent module

To install a module in linux which is statically linked I used the option -non-shared. Which does not compile the code successfully.

Is the option usable only when the code is in certain folder ?

The .ko is generated properly when I dont attempt to use -non-shared option. What are the prerequisites to integrate the module with the kernel permanently.

I need to achieve two things :
1. Make the module as independent as possible(by static linking)
2. Integrate it with the kernel to have it loaded boot time.
Old 06-20-2011, 04:38 PM   #2
Registered: Mar 2011
Location: Surrey B.C. Canada (Metro Vancouver)
Distribution: Slackware
Posts: 183
Blog Entries: 1

Rep: Reputation: 25

You should consult man pages or info conserning modules.

lsmod lists installed modules

insmod installs a kernel module

modprobe to add and remove modules from the Linux kernel

As for the module that doesn't compile you need to read any log files etc to see why. If it compiles as .so and works in the Kernel ??
0 members found this post helpful.
Old 06-30-2011, 01:42 PM   #3
LQ Newbie
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the response, but I did read all those man pages and I realized had to use --non-shared, and since it wasnt working posted.
Nevertheless, the issue got solved when I picked the necessary code from kernel manually and made it into a bin, it stands alone.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to link a static library to a kernel module pallava Linux - Newbie 1 09-26-2007 09:25 PM
module.ko: make, install & used many times. Suddenly modprobe=invalid module format?? GrapefruiTgirl Linux - General 16 08-04-2007 06:40 AM
[root@oprations Module]# make make -C /lib/modules/2.6.18-1.2798.fc6/build SUBDIRS=/r korotania Fedora 7 06-22-2007 04:12 PM
[B]How we can link kernal module statically in kernel?? [/B] htandel Linux - Kernel 2 06-01-2007 07:25 AM
compile and install independent module? doublefailure General 7 03-17-2003 03:59 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:28 PM.

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