-   Programming (
-   -   Load module at boot time (

hguts 01-24-2006 08:52 AM

Load module at boot time
Is there a way to load my own module (it doesnt rely to any hardware) at boot time.

In the the file etc/modules.conf I added
alias kixa kilo_poli.o

After botting up, the module is not loaded but running modprobe kixa will do it (after all thats the purpose of modules.conf).
But, my purpose is to see my module loaded at boot time (at the same time when other modules e.g. net device drivers or serial port are being loaded at boot time).

Well, thru google, I saw some guys talking about a file /etc/modules.autoload/kernel-version but I guess this is specific to a such distro and I do not want to rely to a specific distro.

Best regards.


sirclif 01-24-2006 10:02 AM

Ok, from what i can tell, this is a distro specific process. the /etc/modules.autoload/kernel-version you mentioned is the way gentoo handles it, and it is very simple.

this link has some information on compileing modules, and then configuring your distro to auto load them. It says that debian and redhat have identical boot procedures, so they can be configured the same.

Directly from the website:

Having logged in as root, use your favourite text editor to create a new file called /etc/rc.d/init.d/modules.init with the following contents therein:


# Modules initialisation.
# Start up the module auto-loading daemon.

# Mount all currently unmounted auto-mounted partitions.
/sbin/mount -a

Having created the above file, perform the following steps whilst logged on as root:


cd /etc/rc.d
chmod 755 init.d/*
cd rc3.d
ln -s ../init.d/modules.init 05modules.init

i haven't had to try this, i use gentoo now, but it should work for you.

All times are GMT -5. The time now is 01:50 AM.