Barebone kernel options request
freebsd at edvax.de
Mon Mar 11 07:08:06 UTC 2019
On Sun, 10 Mar 2019 13:58:30 +0100 (CET), samir.otmane at numericable.fr 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 ( https://www.freebsd.org/cgi/man.cgi?query=src.conf )
> 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
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions