Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2019 08:07:56 +0100
From:      Polytropon <freebsd@edvax.de>
To:        samir.otmane@numericable.fr
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Barebone kernel options request
Message-ID:  <20190311080756.6191bb55.freebsd@edvax.de>
In-Reply-To: <ea-mime-5c8509f6-a788-2c4256bf@webmail.numericable.fr>
References:  <ea-mime-5c8509f6-a788-2c4256bf@webmail.numericable.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 10 Mar 2019 13:58:30 +0100 (CET), samir.otmane@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:

https://www.freebsd.org/doc/en/books/handbook/kernelconfig.html

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
modules, though.





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190311080756.6191bb55.freebsd>