# [SOLVED] Invalid module format : Can't load modules

## GivePeaceAChance

Hi,

So I have a bunch of modules that I added to the kernel. 

I ran: 

make clean

make && make modules install.

I copied arch/i686/bzImage over properly

I ran depmod -a

I ran update-modules

I tried to load the module:

# insmod /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.koinsmod: error inserting '/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko': -1 Invalid module format

That same error comes up as a warning during my boot sequence.

Here is my /etc/modules.autoload file.

```

# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.

#

# Note that this file is for 2.6 kernels.

#

# Add the names of modules that you'd like to load when the system

# starts into this file, one per line.  Comments begin with # and

# are ignored.  Read man modules.autoload for additional details.

# For example:

# aic7xxx

nvidia

vboxdrv

snd-page-alloc

soundcore

snd

snd-timer

snd-seq-device

snd-seq-midi-event

snd-seq

snd-pcm

snd-hda-codec

snd-hda-intel

```

And here is my modprobe -l

```

# modprobe -l

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/sha1.ko

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/sha256.ko

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/crypto_null.ko

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/cbc.ko

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/blowfish.ko

/lib/modules/2.6.21-gentoo-r4/kernel/crypto/pcbc.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-rawmidi.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/oss/snd-mixer-oss.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/oss/snd-pcm-oss.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-virmidi.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-device.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-midi-event.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/oss/snd-seq-oss.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-midi.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-pcm.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-page-alloc.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-timer.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/pci/hda/snd-hda-codec.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/pci/hda/snd-hda-intel.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/soc/snd-soc-core.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/drivers/snd-virmidi.ko

/lib/modules/2.6.21-gentoo-r4/kernel/sound/soundcore.ko

/lib/modules/2.6.21-gentoo-r4/kernel/drivers/video/backlight/lcd.ko

/lib/modules/2.6.21-gentoo-r4/kernel/drivers/pcmcia/rsrc_nonstatic.ko

/lib/modules/2.6.21-gentoo-r4/kernel/drivers/pcmcia/yenta_socket.ko

/lib/modules/2.6.21-gentoo-r4/misc/svgalib_helper.ko

/lib/modules/2.6.21-gentoo-r4/misc/vboxdrv.ko

/lib/modules/2.6.21-gentoo-r4/video/nvidia.ko

/lib/modules/2.6.21-gentoo-r4/net/wireless/ipw3945.ko

```

Why can't I load those bloody modules? Now that I know about that, and now that I know those modules aren't being loaded, I suspect they may be causing a bunch of my sound issues. At least I hope so, cause then they'd be fixed.

HEY KIDS, ALWAYS REMEMBER TO DOUBLE-CHECK THAT GRUB IS LOADING THE RIGHT KERNEL... :sLast edited by GivePeaceAChance on Fri Dec 28, 2007 9:39 pm; edited 1 time in total

----------

## desultory

Moved from Installing Gentoo to Kernel & Hardware.

----------

## NeddySeagoon

GivePeaceAChance,

```
emerge -1 module-init-tools
```

and try again.

----------

## GivePeaceAChance

 :Sad: 

I just installed that like you said, and ran:

```

# modprobe /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko

FATAL: Module /lib/modules/2.6.21_gentoo_r4/kernel/sound/core/snd.ko not found.

# insmod /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko

insmod: error inserting '/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko': -1 Invalid module format

```

----------

## NeddySeagoon

GivePeaceAChance,

modprobe knows where to look for your kernel modules, hence providing a path name failed

insmod needs the full path name as you gave it but are you running a kernel called 2.6.21-gentoo-r4 ?

Trying in insert one kernels modules into another kernel will cause this sort of error.

If you want to use insmod use  the command

```
insmod /lib/modules/`uname -r`/kernel/sound/core/snd.ko
```

so insmod asks the kernel for its name. I'm not sure in insmod needs the .ko extension either.

There may also be some useful information in dmesg.

----------

## GivePeaceAChance

If I take out the .ko, and just run, I get this:

```
# insmod /lib/modules/`uname -r`/kernel/sound/core/sndinsmod: can't read '/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd': No such file or directory
```

And the only dir in /lib/modules is 2.6.21-gentoo-r4. my kernel in /boot is kernel-2.6.21-gentoo-r4.

I tried "modprobe ipw3945" to load a module that was already loaded, and it worked fine, no output. but the second I tried "modprobe snd" I got the invalid format errors.

modules.alias:

```

# Aliases extracted from modules themselves.

alias sha1-generic sha1

alias sha256-generic sha256

alias compress_null crypto_null

alias digest_null crypto_null

alias cipher_null crypto_null

alias char-major-116-* snd

alias sound-service-?-0 snd_mixer_oss

alias sound-service-?-3 snd_pcm_oss

alias sound-service-?-12 snd_pcm_oss

alias sound-service-?-1 snd_seq_oss

alias sound-service-?-8 snd_seq_oss

alias pci:v00008086d00002668sv*sd*bc*sc*i* snd_hda_intel

alias pci:v00008086d000027D8sv*sd*bc*sc*i* snd_hda_intel

alias pci:v00008086d0000269Asv*sd*bc*sc*i* snd_hda_intel

alias pci:v00008086d0000284Bsv*sd*bc*sc*i* snd_hda_intel

alias pci:v00008086d0000293Esv*sd*bc*sc*i* snd_hda_intel

alias pci:v00008086d0000293Fsv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001002d0000437Bsv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001002d00004383sv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001002d0000793Bsv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001002d00007919sv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001106d00003288sv*sd*bc*sc*i* snd_hda_intel

alias pci:v00001039d00007502sv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010B9d00005461sv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd0000026Csv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd00000371sv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd000003E4sv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd000003F0sv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd0000044Asv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd0000044Bsv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd0000055Csv*sd*bc*sc*i* snd_hda_intel

alias pci:v000010DEd0000055Dsv*sd*bc*sc*i* snd_hda_intel

alias char-major-14-* soundcore

alias pci:v0000104Cd0000AC13sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Asv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC12sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC15sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Esv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC17sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC19sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Csv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Dsv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Fsv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC51sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC1Bsv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC52sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC56sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC55sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC54sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC41sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd00008011sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC42sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC44sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC46sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC16sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC50sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd00008031sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd00008036sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd00008039sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC8Esv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC8Dsv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC49sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC47sv*sd*bc06sc07i00* yenta_socket

alias pci:v0000104Cd0000AC48sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001411sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001412sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001421sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001422sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001211sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001225sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001410sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001524d00001420sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001180d00000465sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001180d00000466sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001180d00000475sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001180d00000476sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001180d00000478sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001179d0000060Asv*sd*bc06sc07i00* yenta_socket

alias pci:v00001179d0000060Fsv*sd*bc06sc07i00* yenta_socket

alias pci:v00001179d00000617sv*sd*bc06sc07i00* yenta_socket

alias pci:v00001217d*sv*sd*bc06sc07i00* yenta_socket

alias pci:v*d*sv*sd*bc06sc07i00* yenta_socket

alias char-major-195-* nvidia

alias pci:v000010DEd*sv*sd*bc03sc00i00* nvidia

alias pci:v000010DEd*sv*sd*bc03sc02i00* nvidia

alias pci:v00008086d00004222sv*sd*bc*sc*i* ipw3945

alias pci:v00008086d00004227sv*sd*bc*sc*i* ipw3945

```

Here's some output that might be relevant in dmesg. Can you tell me any other output I should be looking for in dmesg?

```

snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

snd_seq: exports duplicate symbol snd_use_lock_sync_helper (owned by kernel)

snd_seq_midi_event: exports duplicate symbol snd_midi_event_new (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

snd_seq: exports duplicate symbol snd_use_lock_sync_helper (owned by kernel)

snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)

snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)

snd_hda_codec: exports duplicate symbol snd_hda_codec_read (owned by kernel)

snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel)

snd: exports duplicate symbol snd_major (owned by kernel)

snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)

snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)

snd_hda_codec: exports duplicate symbol snd_hda_codec_read (owned by kernel)

kobject_add failed for snd_hda_intel with -EEXIST, don't try to register things with the same name in the same directory.

```

----------

## ctgmao

Hello

Execute

```
emerge -C alsa-driver
```

After

```
ls / lib / modules / `uname-r` /
```

Make sure has a folder alsa-driver, if you delete.

This way you will be using alsa kernel.

----------

## GivePeaceAChance

I am not using alsa-driver. I made sure to compile alsa support into the kernel.

----------

## ctgmao

Ok

I talked about the alsa-driver because I had this problem using kernel 2.6.23. I had this problem because I had installed the alsa-driver.

This message kernel says that there is another driver installed with the same name but elsewhere.

For example in my case:

I had the snd_hda_intel folder / lib/modules/2.6.23-gentoo-r3/kernel/drivers/sound / and also had / lib/modules/2.6.23-gentoo-r3/alsa-driver /.

You compiles its driver, as audio module?

----------

## GivePeaceAChance

/lib/modules/2.6.21-gentoo-r4/

```
build          modules.ccwmap       modules.isapnpmap  modules.symbols  video

kernel         modules.dep          modules.ofmap      modules.usbmap

misc           modules.ieee1394map  modules.pcimap     net

modules.alias  modules.inputmap     modules.seriomap   source

```

----------

## GivePeaceAChance

Hi,

Where is the list that tells what modules should be loaded at boot? Because I've commented out all the modules except for nvidia and vboxusers in my /etc/modules.autoload.d/kernel-2.6 and I've even changed all the erroring modules to .bak files, and I still get the Warning messages in my boot process.  There is no kernel-2.4 folder/file for modules - I deleted it to avoid confusion.  So where are these errors coming from?

----------

## NeddySeagoon

GivePeaceAChance,

There are three ways of building ALSA and your dmesg

```
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)

soundcore: exports duplicate symbol sound_class (owned by kernel) 
```

says you have used at least two of them at the same time.

The methods are emerge alsa-drivers ... don't do that.

Built into the kernel by selecting <*>

Built as modules by selecting <M>

Do the following 

```
emerge -C alsa-drivers
```

it will fail if alsa-drivers is not installed. Thats ok,

Now remake and reinstall your kernel and its modules starting with 

```
cd /usr/src/linux

make clean
```

This will ensure you have at most one set of ALSA installed. If your kernel ALSA is set to <*> attempts to load the modules wil fail.

Thats OK as the code is included in the bzImage file.

----------

## PaulBredbury

See wiki.

```
make clean bzImage modules modules_install
```

People make every mistake imaginable, with those options.

----------

## GivePeaceAChance

^^ In reply to Paul:

I'm going through the howto now, and I'm curious about this part:

 *Quote:*   

> Next, re-emerge any packages which provide kernel modules in /lib/modules/, e.g.: 
> 
> rm -f /lib/modules/*/{video/nvidia,fs/fuse,misc/{cdemu,ndiswrapper,vm{mon,net}}}.ko
> 
> emerge -1 nvidia-drivers ndiswrapper
> ...

 

How am I supposed to know which packages I've emerged make modules? I haven't been keeping track up til now, so how do I know which ones to re-emerge?

----------

## PaulBredbury

Read the next line, re module-rebuild.

Very few apps create kernel modules, so it's easy to keep track of manually in your kernel recompilation script.

----------

## NeddySeagoon

GivePeaceAChance,

That remove command is badly broken and should not be used. 

```
rm -f /lib/modules/*/{video/nvidia,fs/fuse,misc/{cdemu,ndiswrapper,vm{mon,net}}}.ko 
```

It removes all modules from all installed kernels that were provided by most but not all packages that install kernel modules.

Working down the list

video/nvidia is nvidia-drivers

fs/fuse is file system in user space

misc/{cdemu,ndiswrapper,vm{mon,net}} is cdemu, ndiswrapper and vmware-modules

If you have installed any of those, you need to reinstall them.

The /*/ causes the command to operate on all your module directories, so it breaks all your previously installed kernels. Its unlikely you want that.

----------

## PaulBredbury

 *NeddySeagoon wrote:*   

> should not be used.

 

It's OK for the target audience of the document, who I have to assume aren't complete idiots.

It seems to be obvious to people that, if a kernel module is missing (e.g. nvidia), they should re-emerge the nvidia package. But, on the other hand, if the kernel module is present but "stale", they will fill the forums with duplicate "Invalid Module Error! WTF??" threads.

----------

## NeddySeagoon

PaulBredbury,

... that gives rise to a whole new class of problems ... like ... I emerged nvidia-drivers and it still won't load ... because the user didn't point /usr/src/linux to the kernel they wanted to build against.

----------

## PaulBredbury

 *NeddySeagoon wrote:*   

> didn't point /usr/src/linux

 

Well, the wiki article does say to use ln, and does include checks, later in the doc.

It's impossible to write a document containing step-by-step instructions, when the users are such idiots that they can't follow step-by-step instructions without making every mistake imaginable.

The normal viewer of my doc will be someone who can't get ALSA working. So it tries to get one kernel version working with ALSA, whilst reducing complexity. It doesn't destroy the other kernels - they will still boot. The other kernels will almost certainly not have ALSA working in them anyway, so what use are they?

The doc is already too complex - witness the number of ALSA threads where they actually post all the info I describe at the bottom of the doc - practically no-one. Too much effort for the poor souls, obviously.

----------

## NeddySeagoon

PaulBredbury,

From the perspective you just outlined ... I agree.

----------

## GivePeaceAChance

OK, looks like I'm a complete idiot then.  :Razz:  SoI guess I'm going to take a few steps back to /etc/modules.d/alsa to save myself, and anyone else who is helping me (a big thank you, btw), some trouble.

Here is the ALSA HDA Intel page:

http://bugtrack.alsa-project.org/main/index.php/Matrix:Module-hda-intel

The first thing I did on this webpage is:

emerge alsa-lib

emerge alsa-utils

I tried 

```
modprobe snd-hda-intel ; modprobe snd-pcm-oss ; modprobe snd-mixer-oss ; modprobe snd-seq-oss
```

but it failed miserably with the "Invalid module format" errors.

The nex tthing I did on that page was straight up copy the following and add it to the end of /etc/modules.conf.  I'm an idiot, so I don't know if I need to, but they said to do so, so I did it.

```

       # ALSA portion

       alias char-major-116 snd

       alias snd-card-0 snd-hda-intel

       # module options should go here

       

       # OSS/Free portion

       alias char-major-14 soundcore

       alias sound-slot-0 snd-card-0

       

       # card #1

       alias sound-service-0-0 snd-mixer-oss

       alias sound-service-0-1 snd-seq-oss

       alias sound-service-0-3 snd-pcm-oss

       alias sound-service-0-8 snd-seq-oss

       alias sound-service-0-12 snd-pcm-oss

```

Here is my resulting modules.conf file:

```

### This file is automatically generated by modules-update

#

# Please do not edit this file directly. If you want to change or add

# anything please take a look at the files in /etc/modules.d and read

# the manpage for modules-update(8).

#

### modules-update: start processing /etc/modules.d/aliases

# Aliases to tell insmod/modprobe which modules to use 

# Uncomment the network protocols you don't want loaded:

# alias net-pf-1 off      # Unix

# alias net-pf-2 off      # IPv4

# alias net-pf-3 off      # Amateur Radio AX.25

# alias net-pf-4 off      # IPX

# alias net-pf-5 off      # DDP / appletalk

# alias net-pf-6 off      # Amateur Radio NET/ROM

# alias net-pf-9 off      # X.25

# alias net-pf-10 off      # IPv6

# alias net-pf-11 off      # ROSE / Amateur Radio X.25 PLP

# alias net-pf-19 off      # Acorn Econet

alias char-major-10-175   agpgart

alias char-major-10-200   tun

alias char-major-81   bttv

alias char-major-108   ppp_generic

alias /dev/ppp      ppp_generic

alias tty-ldisc-3   ppp_async

alias tty-ldisc-14   ppp_synctty

alias ppp-compress-21   bsd_comp

alias ppp-compress-24   ppp_deflate

alias ppp-compress-26   ppp_deflate

# Crypto modules (see http://www.kerneli.org/)

alias loop-xfer-gen-0   loop_gen

alias loop-xfer-3   loop_fish2

alias loop-xfer-gen-10   loop_gen

alias cipher-2      des

alias cipher-3      fish2

alias cipher-4      blowfish

alias cipher-6      idea

alias cipher-7      serp6f

alias cipher-8      mars6

alias cipher-11      rc62

alias cipher-15      dfc2

alias cipher-16      rijndael

alias cipher-17      rc5

# Support for i2c and lm_sensors

alias char-major-89    i2c-dev

### modules-update: end processing /etc/modules.d/aliases

### modules-update: start processing /etc/modules.d/alsa

# Alsa kernel modules' configuration file.

# ALSA portion

# OSS/Free portion

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

# --- BEGIN: Generated by ALSACONF, do not edit. ---

# --- ALSACONF version 1.0.14rc2 ---

alias snd-card-0 snd-hda-intel

alias sound-slot-0 snd-hda-intel

# --- END: Generated by ALSACONF, do not edit. ---

options snd-hda-intel model=toshiba

### modules-update: end processing /etc/modules.d/alsa

### modules-update: start processing /etc/modules.d/i386

alias parport_lowlevel parport_pc

alias char-major-10-144 nvram

alias binfmt-0064 binfmt_aout

alias char-major-10-135 rtc

### modules-update: end processing /etc/modules.d/i386

### modules-update: start processing /etc/modules.d/ipw3945

# modules.d configuration file for IPW3945

# For more information please read:

#    README.ipw3945

# Configurable module parameters

# ------------------------------

# antenna:   select antenna (1=Main, 2=Aux, default 0 [both])

# disable:   manually disable the radio (default 0 [radio on])

# associate:   auto associate when scanning (default 0 off)

# auto_create:   auto create adhoc network (default 1 on)

# led:   enable led control (default 1 on)

# debug:   debug output mask

# channel:   channel to limit associate to (default 0 [ANY])

# rtap_iface:   create the rtap interface (1 - create, default 0)

# mode:   network mode (0=BSS,1=IBSS,2=Monitor)

### modules-update: end processing /etc/modules.d/ipw3945

### modules-update: start processing /etc/modules.d/ipw3945d

install ipw3945 /sbin/modprobe --ignore-install ipw3945; sleep 0.5; /etc/init.d/ipw3945d start

remove ipw3945 /etc/init.d/ipw3945d stop; /sbin/modprobe -r --ignore-remove ipw3945

### modules-update: end processing /etc/modules.d/ipw3945d

### modules-update: start processing /etc/modules.d/nvidia

# Nvidia drivers support

alias char-major-195 nvidia

alias /dev/nvidiactl char-major-195

# To tweak the driver the following options can be used, note that

# you should be careful, as it could cause instability!! For more 

# options see /usr/share/doc/nvidia-drivers-100.14.09/README.gz 

#

#   To enable Side Band Adressing:  NVreg_EnableAGPSBA=1

#

#   To enable Fast Writes: NVreg_EnableAGPFW=1

#

# To enable both for instance, uncomment following line:

#

#options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

# If you have a mobile chip, you may need to enable this option

# if you have hard lockups when starting X.

#

# See: Appendix I. Configuring your laptop

# In /usr/share/doc/nvidia-drivers-100.14.09/README.gz for full details

#

# Choose the appropriate value for NVreg_Mobile from the table:

#        Value      Meaning

#        ----------   --------------------------------------------------

#        0xFFFFFFFF   let the kernel module autodetect the correct value

#        1      Dell laptops

#        2      non-Compal Toshiba laptops

#        3      all other laptops

#        4      Compal Toshiba laptops

#        5      Gateway laptops

#

#options nvidia NVreg_SoftEDIDs=0 NVreg_Mobile=3

# !!! SECURITY WARNING !!!

# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW

# WHAT YOU ARE DOING.

# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,

# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.

options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1

### modules-update: end processing /etc/modules.d/nvidia

### modules-update: start processing /etc/modules.d/svgalib_helper

# modules.d configuration file for SVGALIB_HELPER

# Configurable module parameters

# ------------------------------

# debug:   Debug output level.

# all_devices:   Give access to all PCI devices, regardless of class.

probeall /dev/svga svgalib_helper

### modules-update: end processing /etc/modules.d/svgalib_helper

#COPIED AND PASTED FROM:

#http://bugtrack.alsa-project.org/main/index.php/Matrix:Module-hda-intel

  # ALSA portion

alias char-major-116 snd

alias snd-card-0 snd-hda-intel

# module options should go here

       

# OSS/Free portion

alias char-major-14 soundcore

alias sound-slot-0 snd-card-0

       

# card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

```

I then went BACK to the ALSA gentoo howto, and I'm at the point where it is not necessary to run alsaconf.  I'll continue on my way and simply run update-modules.

After that, I ran:

```
make clean bzImage modules modules_install
```

Am I doing OK up to this point, because the next part may require some questions since I don't know how to use module-rebuild.

i.e. Do I remove the kernels with the rm command listed, then run module-rebuild?

i.e. How do I use it to make my life easy? Do I simply go : module-rebuild -X add [category] and go through EVERY category in the portage tree?

----------

## NeddySeagoon

GivePeaceAChance,

The problem I have with helping you right now is that I don't know where you are.

You must not edit modules.conf.  Its auto generated from /etc/modules.d/* every boot on Gentoo.

snd-alsa-hda is a difficult module to make make work because thare are lots of slightly different pieces of hardware that it covers.

The differences are ensuring you have a recent enough snd-intel-hda for your hardware and you load the module with the right options.

Start with a nice clean kernel tree and rip out alsa-drivers, even if its not installed. Do

```
emerge -C alsa-driver

cd /usr/src/linux

make clean
```

Ignore errors from emerge -C alsa-driver.

Next, configure your kernel for kernel ALSA with OSS support, to be made as modules. 

```
Under Sound  --->

  Advanced Linux Sound Architecture  --->                 

  Open Sound System  --->   

   < > Open Sound System (DEPRECATED)
```

make sure OSS is off.

Inside Advanced Linux Sound Architecture  ---> set

```
  │ │    <M> Advanced Linux Sound Architecture                                   │ │  

  │ │    <M>   Sequencer support                                                 │ │  

  │ │    <M>     Sequencer dummy client                                          │ │  

  │ │    <M>   OSS Mixer API                                                     │ │  

  │ │    <M>   OSS PCM (digital audio) API                                       │ │  

  │ │    [*]     OSS PCM (digital audio) API - Include plugin system             │ │  

  │ │    [*]   OSS Sequencer API                                                 │ │  

  │ │    <M>   RTC Timer support                                                 │ │  

  │ │    [*]     Use RTC as default sequencer timer                              │ │  

  │ │    [ ]   Dynamic device file minor numbers                                 │ │  

  │ │    [*]   Support old ALSA API
```

Under  Generic devices  --->  ensure everything is off

Under  PCI devices  ---> Choose 

```
<M> Intel HD Audio
```

 Set everything else off unless you have more sound cards.

Now build your kernel, install and boot into it.  Check that the time and date shown in uname -a is the new kernel build time.

Until you are in your new kernel do not proceed.

```
 modprobe -l -t sound
```

should list your sound modules.

Next install all the supporting things by following the Gentoo ALSA Guide

DO *not* emerge alsa-driver. It should detect your kernel alsa and refuse anyway. Do everything else the guide suggests except that step.

Add your normal user to the audio group, log out and back in to pick up the new group membership

If you are very lucky, thats it, you unmute your Master and PCM, push the sliders up and you have sound.

Do not unmute any other controls until this works.

Since you have snd-intel-hda, it probably won't work.  Check that your system has /dev/snd and /dev/sound and that the files in them are owned by root and in group audio. 

The last step is to fiddle with module options.  You do that with the routine

```
modprobe -r snd-intel-hda

modprobe snd-intel-hda
```

Test the sound, with a simple command line player. I like 

```
mplayer -ao alsa /path/to/sound/file
```

You will find some options in 

```
less /usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt 
```

Its a big file but you are only interested in the Intel HDA section.

When you find the right option, you can make it be used at startup by including it in /etc/modules.d/alsa

Any problems, stop at the error, tell us what you did, what you think should have happened, what actually happened and provide any error messages from the screen or dmesg verbatim.

----------

## GivePeaceAChance

 *Quote:*   

> Now build your kernel, install and boot into it. Check that the time and date shown in uname -a is the new kernel build time. 
> 
> Until you are in your new kernel do not proceed.

 

Well ****. Maybe I'm too stupid to learn linux.  :Razz:  Shit. ****. I did what you suggested, checked uname -a, and it kept giving me Aug 14, when I originally set up gentoo.  This puzzled me.  Sooooo, over to grub's menu.lst. Lo and behold! I THOUGHT it was loading kernel-2.6.21-gentoo-r4, but it was loading vmlinux-2.6.21-gentoo-r4.  So I changed this, prayed for the best, and **** yeah, no error messages, and the kernels load properly.  ****ing dumbshit I am.  :Razz: 

Well, as long as I didn't make you guys upset with my stupidity, all I can say is, *hopefully* I'm all the more wiser.... (big question mark on that one, but we'll hope for the best).

----------

## NeddySeagoon

GivePeaceAChance,

There are many ways to mess up a kernel install. When you have done it once, you learn that command and apply it as a sanity check, every time.

Its a lesson there is only one way to learn and there is no shame in learning.

----------

