About compiling a new kernel steps

Giorgos Keramidas keramida at freebsd.org
Wed Oct 18 20:56:24 UTC 2006


On 2006-10-12 18:46, Nadow <el.nadow at gmail.com> wrote:
> Hi, in the handbook  Chapter 8 Configuring the FreeBSD Kernel, part 8.3 it
> says
>
> 1. Run config(8) to generate the kernel source code.
>
>        # /usr/sbin/config *MYKERNEL*
>
> 2. Change into the build directory.  config(8) will print the name of
>    this directory after being run as above.
>
>        # cd ../compile/*MYKERNEL*
>
>    For FreeBSD versions prior to 5.0, use the following form instead:
>
>        # cd ../../compile/*MYKERNEL*
>
> 3. Compile the kernel.
>
>        # make depend
>        # make
>
> 4. Install the new kernel.
>
>        # make install
>
> ------------------------------------
>
> But When I do
>
> # /usr/sbin/config *MYKERNEL
>
> The system reminds me to do "make clean depend" before "make depend"
> but in the third step of the handbook "make clean depend" doesnt
> appear. I know it works in both ways but I would like to know if it is
> not better to include the command just in case.

In general, choosing when to do a "make clean" and when not to do it,
requires a fair level of experience with the dependencies between
various kernel options.

If you are not severely limited by time, and can spare a few CPU cycles,
it's always much much safer to build a new kernel with the procedure
recommended in /usr/src/UPDATING:

    # cd /usr/src
    # make KERNCONF=FOO buildworld buildkernel

If you keep your /usr/obj tree around, even between multiple kernel-only
rebuilds, you can ommit the `buildworld' step, and run:

    # cd /usr/src
    # make KERNCONF=BAR buildkernel




More information about the freebsd-doc mailing list