Loading kernel modules on startup

Roland Smith rsmith at xs4all.nl
Sat Aug 30 12:28:12 UTC 2014

On Sat, Aug 30, 2014 at 07:45:09AM +0100, Jamie Griffin wrote:
> I'm just wondering about the correct way to load kernel modules; namely, 
> specifying them in /boot/loader.conf or /etc/rc.conf. For example;

Both are correct. According to rc.conf(5):

kld_list    (str) A list of kernel modules to load right after the local
            disks are mounted.  Loading modules at this point in the boot
            process is much faster than doing it via /boot/loader.conf
            for those modules not necessary for mounting local disk.

> Then, there is kld_list=kldi915 for the vt console driver, and also 
> kern.vty=vt and hw.vga.textmode=1 in loader.conf for the same module.

The first statement is loading a module. The second and third statements are
kernel environment settings. According to vt(4), they can only be set in

> Incidentally, the vt driver did not work properly for me when I used the 
> latter in loader.conf and I had to use the kld_list line in rc.conf(5).

The syntax is different. In loader.conf it should be;


While in rc.conf you should use;


> What is the 'right' method for kernel module loading and is it just 
> easier to compile them into the kernel going forward?

You can compile most modules into a custom kernel if you like. But IMO it's
not really worth the extra effort.

In any case I would advise you to keep a GENERIC kernel and modules around.
If your motherboard dies and you have to replace it you might end up with a
system that doesn't work properly with the custom kernel.

R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20140830/308859c8/attachment.sig>

More information about the freebsd-questions mailing list