# Modules, modules, modules

## supreme_geek_overlord

Okay, well I'm not sure if this should go in "installing gentoo" per sae (perhaps a better one would be "installing new kernels"), but here goes:

Well, after 6 months and many various problems (some of which, I'll admit, were absolute pebkacs), I finally got a fully functional system running. Hmm... I guess that wasn't enough for me: I wasn't fully satisfied with my kernel (I mean, what person who compiles a kernel while he still doen't know anything about linux does?). Soooooooooo, I decided to compile another one!

Now, one of the things I did while I was running around changing settings was move most of the less necessary functions into modules (before, I didn't know a whole lot about them [and perhaps I still don't], so I kindof steered away from those except in the case of things that I know I'll never use but can't resist not compiling). A little while and 0 errors/warnings later, I added the new image to lilo and rebooted just to make sure what I was attempting--keeping two kernels of the same version in at one time--would actually work (namely, boot).

Well anyway, it booted fine, so I booted 'er back to windows. Next day, I came back and tried to mount my windows drive, and it popped up with an error message, which went something like: "cannot mount /dev/hda2 on /mnt/windows: fs type ntfs not supported". Soon did I recall that I had switched this feature to a module. "Well," I thought, "I suppose it is to be expected that I would have to configure the computer to autoload the modules."

Unfortunately that proved harder than I thought. First of all, I really don't know anything about the gentoo 'modules.d' and friends. Second of all, something happened that (per my expectations, which usually manage to be incorrect) is not to be expected: modprobe didn't know what the heck I was talking about when I told it to load 'ntfs'. Now am I wrong (which is likely), or shouldn't 'modules_install' generate an adequate version of 'modules.conf'?

To recap: I don't know a whole lot about modules, I haven't learned much from the man pages, and I decided to see what you guys have to say about the whole situation (after all, people hear seem to tolerate stupid questions  :Wink: ). Any help would be greatly appreciated!

[edit]Just some FYI: fortunately I do still have the original kernel with most of the stuff built in. I guess I'll try to see if I can run on that one for a while...[/edit]

----------

## Boohbah

I've compiled many kernels and my personal preference is to build everything into the kernel and only use modules when i absolutely have to, for nvidia and vmware only.

----------

## gigs_42

To autoload the modules at boot simply place their names in the /etc/modules.autoload.d/kernel-2.x file.  Voila!  You may need to go into the menuconfig again and get the proper module names however.

----------

## supreme_geek_overlord

 *gigs_42 wrote:*   

> To autoload the modules at boot simply place their names in the /etc/modules.autoload.d/kernel-2.x file.  Voila!  You may need to go into the menuconfig again and get the proper module names however.

 

Well for some reason I seem to be having problems with this feature. Like I said, modprobe for some reason cannot find the modules. Not only that, but depmod complains about problems with "unresolved symbol: $blah"'s (where for $blah you can substitue any of my modules [whose existence I have verified, btw]).

Come to think of it, here is another one of those miscellaneous quirks: I followed the installation guide (version prior to the gentoo handbook effort)'s instructions per support of CD recorders, and I compiled the features as modules. Well, it told me something about echoing "ide-scsi/some/wierd/path/to/a/module.o" into the 'autoload.d/kernel-2.4' file, but no such module seems to exist in the /lib/modules directory  :Confused: . Plus, both the new version of the installation guide and gigs here are telling me just to put in the name of the module library, but the old install guide talks about a fully qualified path  :Confused:   :Confused: ; now is this just an interchangable thing or is someone here wrong and the other one right?

----------

## Rainmaker

looks like there's something wrong with your initscripts, if modprobe is compaining about unresolved symbols (I had a topic about a similair issue some time ago   :Rolling Eyes:  )

where did you get the kernel-source? emerge or kernel.org or friends?

----------

## supreme_geek_overlord

Well, the source was from my Gentoo CD. My only speculation therefore is that this might (might, mind you: I never really tried to mess around with the modules on my other kernel, as I never really needed to) have something to do with recompiling the kernel.

----------

## wicki

Just out of curiosity, what were you running to compile your new kernel?

I realize this will show my "noobishness", but I will say that personally before I learned about it, I was completely perplexed about modules as well.

The only step I was leaving out was

```
make modules
```

So now when I recompile a kernel I run:

 *Quote:*   

> make && make modules && make modules_install

 

And doint this it makes all of the module files that it needs and installs them ready to go.

That's the only step I was missing for weeks, anyway.

HTH!   :Cool: 

----------

## curtis119

If you didn't run 'modules_install' then there is no module for modprobe to load. The other thing is that if both of your kernels are the exact same version then the second time you run modules_install it will overwrite the first compile (but you didn't make any modules for the first kernel so this isn't a problem). Modules are installed in:

 /lib/modules/<kernelversion>

After you install the modules and edit /etc/modules.autoload.d/<kernel-version> make sure to run:

modules-update

as root.

----------

## huw

did you do 

```
make mrproper
```

 before recompiling your kernel? Always a good idea when compiling lots of things that were in the kernel as modules and vice-versa. Remeber to backup your .config first..

----------

## supreme_geek_overlord

 *wicki wrote:*   

> Just out of curiosity, what were you running to compile your new kernel?

 

I did the manual install (I've had problems with genkernel and it makes kindof a stupid kernel anyway

 *Quote:*   

> I realize this will show my "noobishness", but I will say that personally before I learned about it, I was completely perplexed about modules as well.

 

Okay, let me take this time to make something clear. I (read carefully:) don't not know anything about modules. I simply just don't know enough. I do, however, know as much as is contained in developerWorks's LPI Exam prep.

 *Quote:*   

> The only step I was leaving out was
> 
> ```
> make modules
> ```
> ...

 

I have done that. Thanks for tryin' anyway.

 *curtis119 wrote:*   

> If you didn't run 'modules_install' then there is no module for modprobe to load. The other thing is that if both of your kernels are the exact same version then the second time you run modules_install it will overwrite the first compile (but you didn't make any modules for the first kernel so this isn't a problem). Modules are installed in:
> 
> /lib/modules/<kernelversion>

 

Awknowledged. As I tried to hint at (but like so many other times was not successfull), I have checked for and verified the existence of every (except for seemingly the exception of the cd-r related ones [see previous post]) module that should have been compiled

 *Quote:*   

> After you install the modules and edit /etc/modules.autoload.d/<kernel-version> make sure to run:
> 
> modules-update
> 
> as root.

 

Like I said, the whole "modprobe" n' friends system seems to be having troubles with finding the modules.

 *huw wrote:*   

> did you do
> 
> ```
> make mrproper
> ```
> ...

 

[stupid n00b mistake alert /]

Hmm... nope. This was a strictly lets-see-what-i-can-figure-out-by-messing-up-the-system effort, so, besides a quick browsing of the makefile to check for obvious pre-recompile routines, I proceeded blindly into remaking it. Well anyway, I'll see what I can do with this new tidbit of information, and in the meanwhile, any lecture on mrproper's function would (like all other info) be greatly appreciated.

----------

## huw

make mrproper is like a "make really clean"

Its explained in the Makefile: 

```
###

# Cleaning is done on three levels.

# make clean     Delete all automatically generated files, including

#                tools and firmware.

# make mrproper  Delete the current configuration, and related files

#                Any core files spread around are deleted as well

# make distclean Remove editor backup files, patch leftover files and the like

```

For an explanation of the name read this thread: http://www.uwsg.iu.edu/hypermail/linux/kernel/0101.3/0107.html

----------

## supreme_geek_overlord

Haha. Interesting name.  Well we do know Linus (or at least one of his merry band) has the geek humor thing goin' on. 

Well, that didn't exactly help, so I decided maybe _not_ running mrproper in the first place made it not really do it's job effectively the second time.

Sooooooo, I reinstalled the system (something that I do rather hastily and, due to all my other installation plights, am rather aquainted to). I configured the kernel similar to how I had it before, and compiled it. Da da da da! It works and is as clean as Meister Proper without running him  :Wink: .

Now that that was over, I decided to do my 2.6 kernel (the branch of which, ironically, managed to have a new version released right smack dab in the middle of my donwloading it  :Rolling Eyes: ). Well, all complaints to the Merry Band aside, I decided to run mrproper before compilation. Now, as far as my  knowledge from browsing the makefile (which I must complement the 2.6 devels for: the extra documentation, clean output, and cleaner code are very nice), this doesn't do anything to anything outside that specific version's jusisdiction, but hey, what the heck, right  :Razz: ?

I guess by now it is almost understood that whatever I do is doomed fail in some way. But I'll tell you anyway: it didn't quite work. Just like last time, depmod kept complaining  :Confused: ! Help here? A little help?

----------

## huw

Why did you reinstall? seems a total waste of time. At the most all you needed to do would be delete the /usr/src/linux dir and /lib/modules/kernel_version dir and then remerge the kernel source - that would give you a complete fresh state. Which is of course what happened when you reinstalled....

As for 2.6, when did you run mrproper? If this was a fresh kernel compile it would have done nothing useful apart from deleting .config. It is like a make clean - when you want to remove core files that have been created during compilation but aren't going to be any good as you've substantially changed your kernel config - ie build lots of things in that were modules before or vice versa - at least that's the only time I use it. 

It's hard to offer more help without you posting the errors - have you updated your /etc/modules.autoload.d/kernel-2.6 file?

----------

## supreme_geek_overlord

 *huw wrote:*   

> Why did you reinstall? seems a total waste of time. At the most all you needed to do would be delete the /usr/src/linux dir and /lib/modules/kernel_version dir and then remerge the kernel source - that would give you a complete fresh state. Which is of course what happened when you reinstalled....

 

Yeah, but as nothing ever seems to work for me, with GRP (which I must use considering I have no Linux-usable connections) I can do it in a couple hours, and I have nothing better to do, I reinstalled. Desperate times call for desperate measures.

 *Quote:*   

> As for 2.6, when did you run mrproper? If this was a fresh kernel compile it would have done nothing useful apart from deleting .config. It is like a make clean - when you want to remove core files that have been created during compilation but aren't going to be any good as you've substantially changed your kernel config - ie build lots of things in that were modules before or vice versa - at least that's the only time I use it.

 

Well, I ran mrproper on the 2.4 kenel before I installed the 2.6. Yes, I already said that I know that this probably doesn't do anything to the 2.6 tree, but I also already said that it wouldn't hurt, so I just did.

 *Quote:*   

> It's hard to offer more help without you posting the errors - have you updated your /etc/modules.autoload.d/kernel-2.6 file?

 

Okay, let me try to make this clear (again). Modifying (or in this case creating) the kernel-2.6 file isn't gonna help anything. Why, you say? Because its kinda useless when you can't even get through modules_install! Lemme restate my problem. When modules_install runs depmod, depmod complains about unresolved symbols. In every module. And aparantly, every symbol in every module. Now do you understand my problem?

----------

## nixnut

Did you do a make dep after the configuration and before make bzImage (or make modules)?

----------

## supreme_geek_overlord

 *nixnut wrote:*   

> Did you do a make dep after the configuration and before make bzImage (or make modules)?

 

Well, yeah on the 2.4 kernel, which is working perfectly. On the 2.6 kernel, simply running make builds everything correctly (aside from running modules_install).

----------

## dAlexis

 *supreme_geek_overlord wrote:*   

>  *nixnut wrote:*   Did you do a make dep after the configuration and before make bzImage (or make modules)? 
> 
> Well, yeah on the 2.4 kernel, which is working perfectly. On the 2.6 kernel, simply running make builds everything correctly (aside from running modules_install).

 

I think, that new module init tools for kernel 2.6.x must be installed. See http://www.kernel.org/pub/linux/kernel/people/rusty/modules/. 0.9.14-pre-something was installed by me (I was too lazy for downloading a new version  :Wink:   ), and modules were installed OK. Read README with attention  :Exclamation:  , install in sbin with moveold and make modules_install will be OK.

----------

## nixnut

 *supreme_geek_overlord wrote:*   

>  *nixnut wrote:*   Did you do a make dep after the configuration and before make bzImage (or make modules)? 
> 
> Well, yeah on the 2.4 kernel, which is working perfectly. On the 2.6 kernel, simply running make builds everything correctly (aside from running modules_install).

 

Well, just try the old fashioned fully manual way:

make mrproper

make menuconfig

make dep

make bzImage

make modules

make modules_install

----------

## supreme_geek_overlord

 *dAlexis wrote:*   

> I think, that new module init tools for kernel 2.6.x must be installed. See http://www.kernel.org/pub/linux/kernel/people/rusty/modules/. 0.9.14-pre-something was installed by me (I was too lazy for downloading a new version   ), and modules were installed OK. Read README with attention  , install in sbin with moveold and make modules_install will be OK.

 

Oh, yeah, I was gonna say something about that. I saw a note about this when I ran modules_install, and then I checked it out. Unfortunately, without my internet connection usable on linux, trying to install it with portage (the only place I knew to get the sources) was a real pain in the *** when I tried the first time. However, now that I know where the official sources are, I can download that.

Well anyway, I'm going away for a couple days, so I'll try it when I get back. Thanks in advance if it works!

----------

## supreme_geek_overlord

Well, I've installed the new module-init-tools, and it seems to be working well: for the most part. The only thing going wrong that seems to be related to the modules is an error that occurs at startup. Init loads all of its junk, and then it goes into what I believe to be the rc-script stage (denoted by the well-formatted semi-color messages). After saying it is doing something with modules (it flashed by to fast on the screen, and I'm to lazy to check the logs), it shows an error and simply says that it could not get dependency information (or something to that accord). However, it then proceeds to successfully load all the automatically-loaded modules.

This doesn't seem to be any kind of fatal error, but is it fixable? Or am I doomed to live with an error for the rest of my life?

----------

## tomk

Moved from Installing Gentoo.

----------

## supreme_geek_overlord

Hey not that I'm trying to violate forum rules or anything, but this is really sinking down in the list and I just wanna try to get some answers. I promise I'll only do this once.

----------

