LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-10-2010, 03:35 PM   #1
ravi_chobey
Member
 
Registered: Sep 2007
Location: Bangalore,India
Distribution: Fedora,Mandriva,Debian
Posts: 180

Rep: Reputation: 30
Thumbs up loading two kernel modules at an instant


Dear All,

I am having device which is having only one USB port and is a boxed device.I want to autodetect a USB drive,which i can do by adding :

/dev/sda1 /mnt/flash vfat auto 0 0

in /etc/fstab.Is it right way for autodetecting a USB drive?

And also, i am having multiple kernel modules in that USB drive, and after autodetecting they will be in /mnt/flash directory of my filesystem.I want to load those modules by adding this line in my /etc/rc.sysinit script,the script is as follows:

if [ -f /mnt/flash/*.ko ]
then
find /mnt/flash/*.ko -print | xargs insmod
fi

but when i am tryng to add two kernel modules,through command line,it is giving: "Unknown symbol found in module".

Please suggest me in sorting this issue.

Regards,
Ravi
 
Old 01-10-2010, 03:41 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I'm going to take a guess that the first thing you should examine, is whether or not these kernel modules were built using the same source as the running kernel. The error message you show, indicates otherwise. "Unknown Symbol" indicates that the module contains code that the kernel doesn't recognize (the kernel and the module are not compatible).

Rebuild the modules using the same source code as the running kernel.

Sasha
 
Old 01-10-2010, 05:57 PM   #3
ravi_chobey
Member
 
Registered: Sep 2007
Location: Bangalore,India
Distribution: Fedora,Mandriva,Debian
Posts: 180

Original Poster
Rep: Reputation: 30
i have checked the source code and kernel version,both are same.In my home directory there are .ko files,which i want to insmod using
"insmod *.ko",but it is giving me error:

insmod: "module.ko":-1 Unknown symbol in module.

Please help me sort this issue.

Regrads,
Ravi
 
Old 01-10-2010, 06:00 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
You may not be able to use the modules from their location on the USb device.

What happens if you move (copy or even symlink may work)) the modules into /lib/modules/$(uname -r)/somewhere and then run the command:

shell# depmod -A

and NOW try to modprobe the modules?

Sasha
 
Old 01-10-2010, 07:12 PM   #5
ravi_chobey
Member
 
Registered: Sep 2007
Location: Bangalore,India
Distribution: Fedora,Mandriva,Debian
Posts: 180

Original Poster
Rep: Reputation: 30
Thumbs up

i have moved my modules as per your suggestions,it works.After that,I want to ask you,why we have to make changes in modules.dep.As far as i know my both the modules are independent of each other.Still i have done as per your suggestions.But after dong "depmod -A" and doing "lsmod",the modules are not in list modules.What we have to do this to make it working for applications?

Regards,
Ravi
 
Old 01-10-2010, 07:24 PM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
If you execute "depmod" command after moving the modules into the modules folder, the kernel examines its modules directory, and updates its dependency information for all modules present, if there have been any changes since last time it did so.

At this stage, `lsmod` will not show anything.

However, if you now MODPROBE your modules (to insert them; similar to insmod but newer), they will appear in `lsmod` output. For example, if your module is called "hello.ko", you would do:

shell# modprobe hello

and now, `lsmod` will show hello.

Whether or not each of your modules depends on the other, is not too important as far as this discussion goes. The important part is that the KERNEL is aware of the modules, and their dependencies, whatever those dependencies may be..
 
1 members found this post helpful.
  


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
Loading Kernel Modules sumahegde Linux - Newbie 1 10-15-2009 09:47 AM
Loading Kernel Modules superdude_876 Linux - Software 1 10-28-2005 11:46 PM
Loading modules error after loading compiled kernel td0l2 Linux - Newbie 12 07-28-2004 11:10 AM
Loading Correct Kernel Modules rridler Linux - Newbie 4 04-15-2004 04:37 PM
Modules not loading in New kernel palanisaravanan Linux - General 1 11-22-2003 06:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:25 AM.

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