LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 12: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:35 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