Custom kernel module list

I would like to read the list of kernel modules that are built into my custom kernel much like /sbin/kldstat offers for the running system's kernel. Suggestions?
 
Its worth mentioning: /etc/rc.d/(pf|pflog|pfsync) all require that the kernel modules be loaded at boot, despite the possibility of them already being included in the kernel. When this loading fails--because the kernel module file does not exist--filtering, logging and/or syncing fail to start. I think that these scripts should use kldstat -qvi -m <name>.ko to check before forcibly loading these kernel modules.
 
Rather crappy and dumb:
Code:
objdump --syms /boot/kernel/kernel | sed -n 's/.* O .* \([^_].*\)_driver$/\1/p' | sort -u
 
Back
Top