You are not logged in.

#1 2006-05-01 23:47:41

WigglerAway
Member
Registered: 2006-04-30
Posts: 14

Lots of unneeded kernel modules loading up

Through trying to get suspend working I noticed just how many kernel modules are loaded on boot up. I've got a quite simple laptop (doesn't even have a cdrom) so really don't need many kernel drivers but I've got irda, loads of sata drivers, firewire, several raid drivers, practically every filesystem I know of (but don't use) etc. I've got hardware detection turned on. Should I get all these modules started up?

I know I can add a !entry in rc.conf but there must be over 80 modules I don't want. Is there anything else I can do?

Offline

#2 2006-05-01 23:52:09

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Lots of unneeded kernel modules loading up

Edit mkinitrd.conf and change it to include only the things you need or enable the hardware detection, then rebuild the initrd (mkinitrd).

Offline

#3 2006-05-02 00:00:57

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Lots of unneeded kernel modules loading up

Remove *all* subsystems you do not need. If, for example, you boot from an IDE drive, you should have this in mkinitrd.conf:

# Disable whole subsystems by setting to "1"
REMOVE_IDE=
REMOVE_SCSI=1
REMOVE_SATA=1
REMOVE_CDROM=1
REMOVE_USB=1
REMOVE_FW=1
REMOVE_RAID=1
REMOVE_DM=1
REMOVE_FS=

Enable autodetection:

# Enable auto-detection of HOSTCONTROLlER and FILESYSTEMS (set to "1")
#   (NOTE: This is still experimental, so it is disabled by default)
AUTODETECT=1

Specify your filesystem, since autodetect doesn't seem to work for that. If it's reiserfs, for example:

# Define which modules are needed by adding "moduleX moduleY"
# If left empty, all modules are included if they are not disabled above
HOSTCONTROLLER_IDE=
HOSTCONTROLLER_SCSI=
HOSTCONTROLLER_SATA=
HOSTCONTROLLER_USB=
FILESYSTEMS="reiserfs"

Remove other extraneous stuff. If, for example, you boot from an IDE drive but don't use an IDE floppy drive, put "ide_floppy" in the REMOVE_MODULE list.

Also, use the module banlist in /etc/rc.conf. If you don't use IPv6, put the ipv6 module in there. Don't use your PC speaker? put pcspkr in the banlist.

Offline

#4 2006-05-02 00:11:08

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Lots of unneeded kernel modules loading up

Yep, that's almost my exact setup (hardware varies, obviously):

Everything REMOVE_d (except IDE and FS), one entry for HOSTCONTROLLER_IDE (alim15x3), one for FILESYSTEMS (jfs), one module manually removed (ide-floppy). That way I get a slim 800k initrd image and no unused modules.

Excluding ipv6 in rc.conf doesn't work, though. After the first few DNS lookups or starting some network apps, it's loaded again.

(1st post, hi everybody smile


1000

Offline

#5 2006-05-02 15:31:16

WigglerAway
Member
Registered: 2006-04-30
Posts: 14

Re: Lots of unneeded kernel modules loading up

Awesome, thanks. Didn't know this was the fault/function of initrd. I'll try it out and check out the wiki (I'm pretty sure I saw some 'hold your hand' type tutorials for initrd).

Cheers guys

Offline

#6 2006-05-02 15:51:45

WigglerAway
Member
Registered: 2006-04-30
Posts: 14

Re: Lots of unneeded kernel modules loading up

I've hit a slight problem, mkinitrd auto doesn't work out the correct config file for the beyond kernel I'm running (it should be kconfig26beyond). I imagine the other errors stem from that but I'm not sure.

Should I create a symbolic link or is there a proper way to configure it?

[james@jt2-arch ~]$ sudo mkinitrd auto --show
Password:
Checking Input...
grep: /boot/kconfig26: No such file or directory
/sbin/mkinitrd: line 172: [: -lt: unary operator expected
grep: /boot/kconfig26: No such file or directory
    Making image for standard Arch kernel ()...
Setting up Parameters...
    /lib/modules/ found
find: /lib/modules//kernel: No such file or directory
Creating Initial RAM Disk...
cat: /tmp/foundmodules: No such file or directory
cat: /tmp/copiedmodules: No such file or directory
>>> Your initrd was created at /boot/initrd26.img

Offline

#7 2006-05-02 16:14:19

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Lots of unneeded kernel modules loading up

-beyond uses mkinitramfs -> /etc/mkinitramfs.conf, same deal as with mkinitrd.


1000

Offline

#8 2006-05-02 18:32:46

WigglerAway
Member
Registered: 2006-04-30
Posts: 14

Re: Lots of unneeded kernel modules loading up

I've now got 90 less modules loaded. I can no doubt remove more using rc.conf when I work out what each one is for.
Thanks

Offline

Board footer

Powered by FluxBB