Solved Kernel compiling options

Hi, I am using FreeBSD 11.2-RELEASE-p2 with "stock" kernel.
How can I gather compiling options of this kernel?

Code:
# uname -a
FreeBSD trevor 11.2-RELEASE-p2 FreeBSD 11.2-RELEASE-p2 #0: Tue Aug 14 21:45:40 UTC 2018     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

thank you
 
Stock kernel basically means a GENERIC kernel, which means that you can also check the kernel image itself for the config file, the config is included by default.

So: strings /boot/kernel/kernel | less. Now, the problem is that the config options are located near the end (around 99%) and it logically doesn't use spaces between those options which makes it a little harder to find. Look for GENERIC, so within less use: /GENERIC and press enter. It will probably find a mismatch first, just press 'n' to search for the next match and you should enter the config section in no time:

Code:
struct vop_spare4_args *
struct vop_spare5_args *
options CONFIG_AUTOGENERATED
ident   GENERIC
machine amd64
cpu     HAMMER
makeoptions     WITH_CTF=1
makeoptions     DEBUG=-g
options XENHVM
options USB_DEBUG
The inclusion of the config file is actually one of the options I disable first when I roll my own kernel ;)
 
Back
Top