best way to rebuild a kernel

i really have an issue with the otherwise outstading FreeBSD Handbook when it comes to kernel building. information on the proper steps to take is really confusing. i think that chapters 9 and 21 need to be combined to give a very concise format on how best to deal with kernel building/rebuidling issues.

that said, i've been told many methods that people suggest are the best way to deal with a kernel.

i'm looking at the following two:

0 # (be root)
1 # cd /usr/src
2 # make buildworld
3 # make buildkernel KERNCONF=<the-file-with-your-kernel-config>
4 # make installkernel KERNCONF=<the-file-with-your-kernel config>
5 # shutdown -r now
6 # make installworld
7 # mergemaster -i

1 # su
2 # cd /usr/src
3 # make update
4 # make buildworld
5 # make buildkernel KERNCONF=<the-file-with-your-kernel-config>
6 # make installkernel KERNCONF=<the-file-with-your-kernel-config>
7 # make installworld
8 # mergemaster -si
9 # shutdown -r now

which one of these do you people like better? if you have your own suggestions, i would be more than happy to take a look at them.

Kernel build?

The details you have provided are NOT for a kernel build, but are in fact for a FreeBSD upgrade - it's called a "make buildworld" process.

In fact, a kernel build (and only a kernal build) is as follows:

(1) cd /usr/src/sys/i386/conf
(2) make a copy of GENERIC and call it something else, eg MYKERNEL
(3) edit MYKERNEL correctly
(4) /sbin/config MYKERNEL
(5) cd ../../config/MYKERNEL
(6) make depend
(7) make
(8) make install
(9) if all has gone well, reboot!

I have summarised Chapter 9.3 of the handbook:

Let me know if you have any further problems