Barebone kernel options request

samir.otmane at samir.otmane at
Mon Mar 11 12:15:18 UTC 2019

Sorry I misspoke, there's things in kernel-land that i'd like to avoid but i've seen no options so far for it. (like as it could be nooptions JAIL)
I'm already aware of kernel configuration file, i'm just asking if one can help to get like that (some kind of patch that would add code like #ifdef JAIL ... #endif).

---- Message d'origine ----
De : "Polytropon" <freebsd at>
À : samir.otmane at
Objet : Re: Barebone kernel options request
Date : 11/03/2019 08:07:56 CET
Copie à : freebsd-questions at

On Sun, 10 Mar 2019 13:58:30 +0100 (CET), samir.otmane at wrote:
> For my purpose, i would like to get a very barebone FreeBSD kernel
> ( For instance i don't want jaling, i'll want to get rid of unwanted
> overhead ), but i don't know how to do so.
> IRC chatters told me that it would be very challenging to do so.

Not really. :-)

First of all, read chapter 8, "Configuring the FreeBSD Kernel"
in The FreeBSD Handbook:

You will then make a copy of the GENERIC kernel configuration file
and adjust it to your needs, i. e., remove all the entries you do
not need. Then you can go ahead and build a kernel based on that
configuration file, install it, and boot it. Pay attention to the
correct version match of source, world, and kernel on your system.

Also read the comment header of /usr/src/Makefile, it contains a
nice summary of build targets. You will also find further instructions
in "man 7 build".

I've been following the tradition of a custom kernel for many years
in the past, especially for performance and speed reasons, as well
as for following the mindset "I don't have it, therefore I don't
need it". Today, this doesn't seem to be a valid reason anymore,
but you can always cite security considerations... ;-)

Sometimes people will tell you: "Don't write your own configuration
file by altering a copy of GENERIC; instead just include GENERIC,
add what you want to add, and use nodevice and nooption for what
you don't want from GENERIC." Personally, I think this will cause
much more work if your goal is to _reduce_ the kernel, instead of
just inflating it with additional stuff. But of course, that method
will work, too.

> I found that page ( )
> but it only disables user-land program building, not kernel-land code.

That is correct. The /etc/src.conf file's purpose is to control
the build caused by "make buildworld" and has little effect on
the kernel - you can use it to avoid building certain kernel
modules, though.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
freebsd-questions at mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list