LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 12-10-2004, 01:44 AM   #1
b123coder
Member
 
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
how to add own 2 kernel modules to kernel


I have written 2 modules that i want to be loaded each time kernel has been loaded. I add them in kernel directory of kernel source but i am getting following error
deny2.o(.text+0x50): In function `init_module':
: multiple definition of `init_module'
deny1.o(.text+0x190): first defined here
ld: Warning: size of symbol `init_module' changed from 110 to 57 in deny2.o
deny2.o(.text+0x90): In function `cleanup_module':
: multiple definition of `cleanup_module'
deny1.o(.text+0x200): first defined here
ld: Warning: size of symbol `cleanup_module' changed from 29 to 17 in deny2.o
make[2]: *** [kernel.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.24-module/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.24-module/kernel'
make: *** [_dir_kernel] Error 2

Both kernel modules have following similar calls code

static void __init init(void)
{
nfho.hook = hook_func;
nfho.hooknum = NF_IP_POST_ROUTING;
nfho.pf = PF_INET;
nfho.priority = NF_IP_PRI_FIRST;

nf_register_hook(&nfho);


}

static void __exit fini(void)
{
nf_unregister_hook(&nfho);
}


module_init(init);
module_exit(fini);
MODULE_LICENSE("GPL");


how to solve this error?
 
  


Reply


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 add 'modules' without re-compiling the kernel b0nd Linux - Newbie 4 10-03-2005 11:22 AM
kernel : how to add sys call through modules only? pinkeshzaveri Programming 1 09-14-2005 04:17 AM
kernel: No module symbols loaded - kernel modules not enabled. Qucho Debian 9 05-26-2004 03:50 AM
How to keep modules/drivers across kernel recompiles and kernel versions? Pisces107 Linux - General 5 01-21-2004 09:29 PM
need to recompile modules if i add something to kernel option? doublefailure Linux - General 1 03-05-2003 11:31 PM


All times are GMT -5. The time now is 10:03 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration