# [Solved] How do I make and install modules?

## utente

OK, being a clueless noob as I am, let me ask the plain question...

Things I did:

I configured a 2.6.12-r8 kernel on an AMD64 platform with module support;

Configured some minor options (parallel port, gameport, TV cards and something else)  to build as modules;

Done "make bzImage", "make modules", "make modules_install";

"cp arch/x86_64/boot/bzImage /boot/kernel-2.6.12-gentoo-r8";

"cp .config /boot/config-2.6.12-gentoo-r8";

"rm /etc/modules.d/kernel-2.6";

created above file as new with the list of modules just built (find /lib/modules/2.6.12-gentoo-r8/ -name ecc.ecc.); (UHM didn't took full pathnames, only module filenames as stated in the gentoo installation guide...)

"modules-update";

rebooted system.

Result: NOT A SINGLE MODULE LOADS at boot time ("FATAL: Module xxx not found" for each one). After the boot, the system is working but /proc/modules is empty, /proc/ksyms does not exist, there is no way to load any module with insmod or modprobe.

What did I do wrong?Last edited by utente on Mon Aug 15, 2005 1:48 am; edited 2 times in total

----------

## Dlareh

```
uname -r

mount /boot

$EDITOR /boot/grub/grub.conf
```

----------

## utente

uname -r returns "2.6.12-gentoo-r8".

The running kernel is the right one (the last I compiled), since uname -a returns the right timestamp...

other clues?

----------

## Dlareh

```
lsmod

modprobe -ls

modprobe foo

lsmod
```

----------

## utente

lsmod:

Module                  Size  Used by

(nothing)

modprobe -ls:

the full content of /etc/modules.d/kernel-2.6 file, verbatim, but in reverse order (first rows last and vice versa)

modprobe foo:

FATAL: Module foo not found.

lsmod:

Module                  Size  Used by

(nothing)

I put in /etc/modules.d/kernel-2.6 the full pathnames for each module, rebooting system now... BRB few minutes

----------

## freelight

Are you sure you did make modules_install? See if the modules are actually present:

ls -R /lib/modules/2.6.12-gentoo-r8/

----------

## utente

Yes I am sure... modules are where they are supposed to be.

ls -R /lib/modules/2.6.12-gentoo-r8:

/lib/modules/2.6.12-gentoo-r8/:

build          modules.ccwmap       modules.inputmap   modules.symbols  video

kernel         modules.dep          modules.isapnpmap  modules.usbmap

modules.alias  modules.ieee1394map  modules.pcimap     source

/lib/modules/2.6.12-gentoo-r8/kernel:

crypto  drivers  fs  lib  net  sound

/lib/modules/2.6.12-gentoo-r8/kernel/crypto:

aes.ko     blowfish.ko  crc32c.ko       md4.ko          sha256.ko  tgr192.ko

anubis.ko  cast5.ko     crypto_null.ko  michael_mic.ko  sha512.ko  twofish.ko

arc4.ko    cast6.ko     khazad.ko       serpent.ko      tea.ko     wp512.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers:

bluetooth  ieee1394  input  md  media  message  mmc  net  scsi  usb  video

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/bluetooth:

bcm203x.ko  bfusb.ko  bpa10x.ko  hci_uart.ko  hci_usb.ko  hci_vhci.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/ieee1394:

eth1394.ko  ieee1394.ko  ohci1394.ko  video1394.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/input:

joystick  mouse

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/input/joystick:

adi.ko      grip.ko       interact.ko    stinger.ko     warrior.ko

db9.ko      grip_mp.ko    magellan.ko    tmdc.ko

gamecon.ko  guillemot.ko  sidewinder.ko  turbografx.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/input/mouse:

sermouse.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/md:

raid5.ko  raid6.ko  xor.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media:

common  dvb  video

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/common:

saa7146.ko  saa7146_vv.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb:

b2c2  bt8xx  cinergyT2  dibusb  frontends  ttpci  ttusb-budget  ttusb-dec

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/b2c2:

b2c2-flexcop.ko  b2c2-flexcop-pci.ko  b2c2-flexcop-usb.ko  skystar2.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/bt8xx:

bt878.ko  dst_ca.ko  dst.ko  dvb-bt8xx.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/cinergyT2:

cinergyT2.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/dibusb:

dvb-dibusb.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/frontends:

cx22700.ko         dib3000mc.ko  nxt2002.ko  sp887x.ko    tda1004x.ko

cx24110.ko         l64781.ko     nxt6000.ko  stv0297.ko   tda8083.ko

dib3000-common.ko  mt312.ko      or51211.ko  stv0299.ko   ves1820.ko

dib3000mb.ko       mt352.ko      sp8870.ko   tda10021.ko  ves1x93.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/ttpci:

budget-av.ko  budget-core.ko  budget-patch.ko  ttpci-eeprom.ko

budget-ci.ko  budget.ko       dvb-ttpci.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/ttusb-budget:

dvb-ttusb-budget.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/dvb/ttusb-dec:

ttusbdecfe.ko  ttusb_dec.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/video:

bw-qcam.ko  c-qcam.ko  saa5246a.ko  saa5249.ko  saa7134  tuner-3036.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/media/video/saa7134:

saa6752hs.ko  saa7134-empress.ko  saa7134.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/message:

i2o

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/message/i2o:

i2o_block.ko  i2o_config.ko  i2o_scsi.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/mmc:

mmc_block.ko  mmc_core.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/net:

8139cp.ko   bsd_comp.ko   ppp_deflate.ko  pppox.ko        slhc.ko

8139too.ko  ne2k-pci.ko   ppp_generic.ko  ppp_synctty.ko  wireless

8390.ko     ppp_async.ko  pppoe.ko        s2io.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/net/wireless:

atmel.ko      hermes.ko   orinoco_pci.ko  orinoco_tmd.ko  strip.ko

atmel_pci.ko  orinoco.ko  orinoco_plx.ko  prism54

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/net/wireless/prism54:

prism54.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/scsi:

aic7xxx  sr_mod.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/scsi/aic7xxx:

aic79xx.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb:

class  image  input  media  misc

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/class:

cdc-acm.ko  usb-midi.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/image:

mdc800.ko  microtek.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/input:

aiptek.ko  wacom.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/media:

dabusb.ko  ov511.ko  pwc  se401.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/media/pwc:

pwc.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/usb/misc:

rio500.ko  usblcd.ko  usbled.ko

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/video:

backlight

/lib/modules/2.6.12-gentoo-r8/kernel/drivers/video/backlight:

backlight.ko  lcd.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs:

coda  hfs  hfsplus  hpfs  ntfs  romfs  udf  ufs

/lib/modules/2.6.12-gentoo-r8/kernel/fs/coda:

coda.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/hfs:

hfs.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/hfsplus:

hfsplus.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/hpfs:

hpfs.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/ntfs:

ntfs.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/romfs:

romfs.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/udf:

udf.ko

/lib/modules/2.6.12-gentoo-r8/kernel/fs/ufs:

ufs.ko

/lib/modules/2.6.12-gentoo-r8/kernel/lib:

crc-ccitt.ko  libcrc32c.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net:

8021q  bluetooth  decnet  llc  sched

/lib/modules/2.6.12-gentoo-r8/kernel/net/8021q:

8021q.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/bluetooth:

bnep  hidp  l2cap.ko  rfcomm  sco.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/bluetooth/bnep:

bnep.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/bluetooth/hidp:

hidp.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/bluetooth/rfcomm:

rfcomm.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/decnet:

decnet.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/llc:

llc2.ko

/lib/modules/2.6.12-gentoo-r8/kernel/net/sched:

sch_cbq.ko  sch_hfsc.ko  sch_htb.ko

/lib/modules/2.6.12-gentoo-r8/kernel/sound:

core  drivers

/lib/modules/2.6.12-gentoo-r8/kernel/sound/core:

oss  seq

/lib/modules/2.6.12-gentoo-r8/kernel/sound/core/oss:

snd-mixer-oss.ko  snd-pcm-oss.ko

/lib/modules/2.6.12-gentoo-r8/kernel/sound/core/seq:

oss                snd-seq.ko             snd-seq-midi.ko

snd-seq-device.ko  snd-seq-midi-event.ko  snd-seq-virmidi.ko

/lib/modules/2.6.12-gentoo-r8/kernel/sound/core/seq/oss:

snd-seq-oss.ko

/lib/modules/2.6.12-gentoo-r8/kernel/sound/drivers:

mpu401  snd-dummy.ko  snd-serial-u16550.ko  snd-virmidi.ko

/lib/modules/2.6.12-gentoo-r8/kernel/sound/drivers/mpu401:

snd-mpu401.ko

/lib/modules/2.6.12-gentoo-r8/video:

fglrx.ko

Putting full pathname in the /etc/modules.d/kernel-2.6 file didn't solved anything, I got the same errors.

Tried the same "lsmod + modprobe -ls + modprobe foo + lsmod" command sequence as above: same result. No change.

----------

## utente

UPDATE: after rebooting, now there is ONE module installed!!!  :Shocked: 

lsmod:

Module                  Size  Used by

ntfs                   89664  1

Funny though... I configured NTFS support NOT to be modulixed, but builtin the kernel...  :Question: 

Tried MODPROBE FOO: same old error: FATAL: Module foo not found...

----------

## utente

UPDATE: at last I discovered that the file /lib/modules/2.6.12-gentoo-r8/modules.dep was empty.

So I ran depmod but it didn't had effect on modules.dep: so I did

depmod -n > /root/modulesdep.raw

to get a file to edit, to craft a working copy of modules.dep... and after doing this and edited the raw copy I take a look to the original modules.dep and... there were all of the dependency data!  :Shocked:   I think there is something wrong with my depmod exe... however, now modprobe <module> works, modules are loaded and unloaded correctly and lsmod shows loaded modules. But, but... autoload script at boot still fails miserably to load any module  :Confused:  Oh well... maybe I should erase all that gentoo modules crap and write a good old "modprobe x modprobe y modprobe z..." script  :Wink: 

----------

## Dlareh

put your good ol' modprobe x modprobe y modprobe z stuff in /etc/conf.d/local.start

----------

## utente

FINAL UPDATE: now it's (almost) all OK.

Putting only the module names (no path & no extension) in the /etc/modules.autoload.d/kernel-2.6 fixed the autoload problem too. Now it's just the module fglrx (ATI RADEON graphic drivers) that refuses to load, but this should be another story...

I hope this thread be useful to someone else  :Very Happy: 

----------

