# Postpone kernel module load



## alie (Dec 22, 2009)

Hi guys,

Is there any way to postpone kernel module load during boot time and i dont want put it on loader.conf ?

I want postpone nvidia & snd_hda module after KDM is loaded.

Thanks,
-Alie


----------



## sixtydoses (Dec 22, 2009)

Not sure but I think you can write the kldload script and place it in /etc/rc.d.


----------



## crsd (Dec 22, 2009)

Doesn't KDM require running X server (which would hardly work without loaded nvidia module, if you are using nvidia-driver)?


----------



## alie (Dec 22, 2009)

crsd said:
			
		

> Doesn't KDM require running X server (which would hardly work without loaded nvidia module, if you are using nvidia-driver)?



Good point!

So i have a plan to write my own script to load all the kernel modules after KDM is loaded except for nvidia module.


----------



## SirDice (Dec 22, 2009)

Why?!?


----------



## phoenix (Dec 22, 2009)

Just don't include the drivers in the kernel, and don't list them in /boot/loader.conf.  That way, the modules won't be loaded automatically at boot time.

If this is a single-user system, then you can write a script that will kldload each of the modules, and put that into the *Autostart* directory for your window manager/DE (KDE uses ~/.kde/Autostart/).  Any executable scripts in the Autostart directory will be run automatically as part of the login process.

If this is a multi-user system, you can write an RC script that will call your script as part of the "start" section.  Be sure to put *kdm* into the REQUIRE line, and possibly into the AFTER line, so that it's not run until after kdm is running.


----------



## alie (Dec 23, 2009)

SirDice said:
			
		

> Why?!?



Becoz i am trying to speed up the boot time from 45 seconds to 25 seconds


----------

