LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2003, 04:29 PM   #1
budzynm
LQ Newbie
 
Registered: Jul 2003
Location: Woodbridge, NJ
Distribution: Redhat 7
Posts: 13

Rep: Reputation: 0
Question kernel newbie: modprobe error


Howdy!

I had originally RH 7.1 installed.

Recently I rolled my own kernel: 2.4.21.

The problem is I get these errors during start-up. I've copied them from my 'messages' log file:
Jul 26 00:06:05 www modprobe: modprobe: Can't locate module char-major-17
Jul 26 00:06:05 www modprobe: modprobe: Can't locate module char-major-43
Jul 26 00:06:06 www modprobe: modprobe: Can't locate module char-major-48
Jul 26 00:06:06 www modprobe: modprobe: Can't locate module char-major-112
Jul 26 00:06:06 www modprobe: modprobe: Can't locate module char-major-171
Jul 26 00:06:07 www modprobe: modprobe: Can't locate module char-major-57
Jul 26 00:06:07 www modprobe: modprobe: Can't locate module char-major-46
Jul 26 00:06:07 www modprobe: modprobe: Can't locate module char-major-174
Jul 26 00:06:08 www modprobe: modprobe: Can't locate module char-major-154
Jul 26 00:06:08 www modprobe: modprobe: Can't locate module char-major-148
Jul 26 00:06:08 www modprobe: modprobe: Can't locate module char-major-188
Jul 26 00:06:09 www modprobe: modprobe: Can't locate module char-major-105
Jul 26 00:06:09 www modprobe: modprobe: Can't locate module char-major-75
Jul 26 00:06:09 www modprobe: modprobe: Can't locate module char-major-32
Jul 26 00:36:35 www modprobe: modprobe: Can't locate module char-major-19
Jul 26 00:36:36 www modprobe: modprobe: Can't locate module char-major-164
Jul 26 00:36:38 www modprobe: modprobe: Can't locate module char-major-22
Jul 26 00:36:39 www modprobe: modprobe: Can't locate module char-major-24
Jul 26 00:36:41 www modprobe: modprobe: Can't locate module char-major-71

And they repeat a few more times. The box is working fine. I would like to understand what this error is all about and how to fix it. Based on the research that I've found there char-major have to do something with the type of modules that need to be loaded/identified. Is that right? Where is the file that modprobe uses in order to know to search for these?

ANY INFO or a link to more info would be greatly appreciated!!!!

Thanks.
-mark
 
Old 08-01-2003, 04:42 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
When you compiled your own kernel as well as doing a

make config or make menuconfig or make xconfig
make depend
make clean
make bzImage
make install

did you also do

make modules
make modules_install

The reason why you are getting all these message is because
things are looking for modules which are not available.

If they have been compiled into the kernel as opposed to being separate module files, then you have to silence the message by putting entries into
/etc/modules.conf

As I prefer to have most things compiled into the kernel as opposed to being totally modular, I have lots of lines such as

# Block device modules
#
alias block-major-3 off
alias block-major-22 off
alias block-major-33 off
alias block-major-34 off
...


in my modules.conf file to keep things quiet.

But you are to be commended on taking the step in compiling your own kernel, since a customized kernel, provided it is correctly done, will give you the best performance for your system.

To see the assigned device number mappings, look in

/usr/src/linux/Documentation/devices.txt


Last edited by Corin; 08-01-2003 at 04:44 PM.
 
Old 08-01-2003, 08:40 PM   #3
budzynm
LQ Newbie
 
Registered: Jul 2003
Location: Woodbridge, NJ
Distribution: Redhat 7
Posts: 13

Original Poster
Rep: Reputation: 0
more module stuff

Yup, I did do:

make modules
make modules_install

but, as you had mentioned, i had most of the stuff I care about compiled directly into the kernel.

I tried adding the following so as to quiet the modprobe errors by adding to my modules.conf:

alias block-major-17 off
..and so on for the items that have been giving me the errors

However, two interesting things happen:
1. When I went to shut down and startup modprobe noted to me that modules.conf is more recent than modules.dep
2. The errors came back, even with the 'alias block-major-X off' (quotes mine)

My question: Is the modules.dep controlling what modules are trying to be located by modprobe? If that's true does that mean that when I configured my kernel I must have omitted something?

If I cross-index /usr/src/linux/Documentation/devices.txt
with modules.dep will I be able to figure out which modules are causing my errors? If that's true then I can go back to xconfig and make sure I correct those options.

Or am I smoking something funny and missing the whole point...

Any thoughts would be greatly appreciated?

And many thanks for your previous response!!
-mark
 
Old 08-01-2003, 09:27 PM   #4
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Re: more module stuff

Quote:
Originally posted by budzynm
make modules
make modules_install
That's good -- but obviously we had to check that you do have the modules compiled and installed that you actually need.

Quote:
alias block-major-17 off
..and so on for the items that have been giving me the errors

However, two interesting things happen:
1. When I went to shut down and startup modprobe noted to me that modules.conf is more recent than modules.dep
2. The errors came back, even with the 'alias block-major-X off' (quotes mine)
That is because modules.dep is more recent than module.conf.

To correct this error (apologies for my omission) you need to do a

depmod -a

which updates the modules.dep file using information in the modules.conf file.

My excuse is I thought that in one of the /etc/init.d scripts it always did a depmod -a for you, but perhaps that has been added since the RedHat 7 which you are using.

So if you do that and try rebooting again, hopefully those annoying messages should for the most part be silenced.

Quote:
My question: Is the modules.dep controlling what modules are trying to be located by modprobe?
Yes exactly! And not only that, they list the dependencies on each module.

So if you do a

modprobe -a some_module

(note you have to use the -a , automatically load up dependent modules)

then it will insmod all of the modules you need, not just the one you specified.

[QUOT]If that's true does that mean that when I configured my kernel I must have omitted something?[/QUOTE]

No. If you had omitted something necessary, then something would be broken and you claimed that all was working as it should.

As far as I know here is why those error messages appear, and as far as I know, they appear not because of the kernel booting but because an executable program called in /etc/init.d/script is being called.

A program is to be executed but the program needs to access a device. So first of all the module loading program, if the device is not turned off in the modules.conf file, tries to find a module to load. This fails because the module does not exist so an error message is issued. However the support for the device is already included in the monolithic kernel, hence the program works.

Quote:
If I cross-index /usr/src/linux/Documentation/devices.txt with modules.dep will I be able to figure out which modules are causing my errors?
You got it!!! When I was getting all my messages I eventually found out by searching with Google that I could find out to what "char-major-188" or whatever was actually referring. There was a file which listed all of these numbers and that was /usr/src/linux/Documentation/devices.txt. So error message by error message I went through the numbers and discovered that for all of them, they were devices that I did not have on my system or that I had compiled into the monolithic kernel.

Quote:
If that's true then I can go back to xconfig and make sure I correct those options.
Exactly - you have fully understood the scheme of things!

Either you do not have the physical device or it is compiled into the kernel.

Just a point of information, but how are these numbers actually used?

Well remember you have a /dev directory and that you use

mknod

with a major number and either a character or block device?

Well in userspace, programs use the character name of the device eg /dev/dsp, /dev/hda, but these are pointers to device node numbers (dsp is 14, nvidia is 195)

So if you go to the source code for the device driver module, you will see lines in the C code similar to --

nv.h:#define NV_MAJOR_DEVICE_NUMBER 195

nv.c:int nv_major = NV_MAJOR_DEVICE_NUMBER;
...
nv.c: rc = devfs_register_chrdev(nv_major, "nvidia", &nv_fops);
...
nv.c: rc = register_chrdev(nv_major, "nvidia", &nv_fops);

Hopefully you now see how the kernel modules and the device files are related.

Last edited by Corin; 08-01-2003 at 09:30 PM.
 
Old 08-27-2003, 11:45 AM   #5
budzynm
LQ Newbie
 
Registered: Jul 2003
Location: Woodbridge, NJ
Distribution: Redhat 7
Posts: 13

Original Poster
Rep: Reputation: 0
followup to kernel modules

Many thanks for the info.

Using 'depmod -a' did the trick.

Error messages are now gone. Woohoo!

Also, I appreciate the additional info on how the modules work.

To make sure I understand; are the following correct:

- The numbers identified in the error messages are the major numbers for a character or block device
- the character names in /dev are essentially pointers that point to the major numbers
- /usr/src/linux/Documentation/devices.txt describes what each number is (driver)
- When a program wants to access a device and it's listed as a module (listed in modules.conf) it attempts to load that module--it then logs an error if it's not available as a module but will still work in the case of a monolithic kernel
- modules.dep automatically tracks all module dependencies for the modules identified in modules.conf
- modules.dep is rebuilt when 'depmod -a' is run

Hmmm... please allow me another question--how is modules.conf built? Is it modified by a new kernel build when I do:

make modules
make modules_install

Or is it something that comes pre-built in the kernel and is manually modified for each distro?

I'm trying to get my brain wrapped around how modules work so please bear with me.

Again, thanks.
-mark
 
Old 08-27-2003, 12:11 PM   #6
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Hi Mark!

Quote:
how is modules.conf built?
In the case of Debian, modules.conf is created by running update-modutils, which puts together all of the files in the /etc/modutils directory which are either handcrafted or created by the individual Debian package installation scripts at the time of package installation.

In the case of Red Hat, the modules.conf file is something you have to edit and create yourself.

$ rpm -qf /etc/modules.conf
file /etc/modules.conf is not owned by any package

When you do make modules and make module_install, nothing happens with regard to the modules.conf file. The modules.conf file is also not affected by your kernel configuration and compilation, but it may need to be manually modified as a result!

And with regard to your summation, you have indeed understood well the module loading scheme and the role of major numbers and device files.
 
  


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
Modprobe error lucifersangel Linux - Wireless Networking 1 11-27-2005 03:11 PM
Newbie kernel compile error Reefcrazed Linux - Newbie 3 05-07-2004 08:35 AM
modprobe error? GraemeK Linux - Networking 2 12-26-2003 01:23 PM
Modprobe Error While Booting New Kernel DeadPuddle Slackware 2 11-18-2003 05:00 AM
modprobe error GT I.N.C Linux - Newbie 0 07-13-2002 08:03 AM

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

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