- remove "traditional" way of building kernel and add it to the

developers' handbook instead

Approved by: keramida (mentor), trhodes (mentor)
This commit is contained in:
Daniel Gerzo 2006-10-16 19:15:36 +00:00
parent 84de0217ca
commit b5a92a5409
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=28876
5 changed files with 112 additions and 38 deletions
en_US.ISO8859-1/books
developers-handbook
handbook/kernelconfig

View file

@ -86,6 +86,7 @@
<title>Kernel</title>
&chap.dma;
&chap.kernelbuild;
&chap.kerneldebug;
</part>

View file

@ -23,6 +23,7 @@
<!-- Part three - Kernel -->
<!ENTITY chap.dma SYSTEM "dma/chapter.sgml">
<!ENTITY chap.kernelbuild SYSTEM "kernelbuild/chapter.sgml">
<!ENTITY chap.kerneldebug SYSTEM "kerneldebug/chapter.sgml">
<!-- Part five - Architectures -->

View file

@ -0,0 +1,15 @@
#
# Build the Handbook with just the content from this chapter.
#
# $FreeBSD$
#
CHAPTERS= kernelconfig/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

View file

@ -0,0 +1,88 @@
<!--
The FreeBSD Documentation Project
$FreeBSD$
-->
<chapter id="kernelbuild">
<title>Bulding and Installing a &os; Kernel</title>
<para>Being a kernel developer requires understanding of the kernel
build process. To debug the &os; kernel it is required to be able
to build one. There are two known ways to do so:</para>
<itemizedlist>
<listitem>
<para>The <quote>Traditional</quote> Way</para>
</listitem>
<listitem>
<para>The <quote>New</quote> Way</para>
</listitem>
</itemizedlist>
<note>
<para>It is supposed that the reader of this chapter is familiar
with the information described in the <ulink
url="../handbook/kernelconfig-building.html">Building and
Installing a Custom Kernel</ulink> chapter of the &os;
Handbook. If this is not the case, please read through the above
mentioned chapter to understand how the build process
works.</para>
</note>
<sect1 id="kernelbuild-traditional">
<title>Building a Kernel the <quote>Traditional</quote> Way</title>
<para>Up to version 4.X of &os; this was the recommended way to
build a new kernel. It can still be used on newer versions
(instead of the <quote>buildkernel</quote> target of the toplevel
<filename role="directory">/usr/src/</filename> makefiles).
Building the kernel this way may be useful when working on the
kernel code and it may actually be faster than the
<quote>New</quote> procedure when only a single option or two were
tweaked in the kernel configuration file. On the other hand, it
might lead to unexpected kernel build breakage when used by
beginners on newer versions of &os;.</para>
<procedure>
<step>
<para>Run &man.config.8; to generate the kernel source
code:</para>
<screen>&prompt.root; <userinput>/usr/sbin/config <replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>Change into the build directory. &man.config.8; will
print the name of this directory after being run as
above.</para>
<screen>&prompt.root; <userinput>cd ../compile/<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>Compile the kernel:</para>
<screen>&prompt.root; <userinput>make depend</userinput>
&prompt.root; <userinput>make</userinput></screen>
</step>
<step>
<para>Install the new kernel:</para>
<screen>&prompt.root; <userinput>make install</userinput></screen>
</step>
</procedure>
</sect1>
<sect1 id="kernelbuild-new">
<title>Building a Kernel the <quote>New</quote> Way</title>
<para>This procedure is well supported and recommended under the
latest &os; releases and is documented in the <ulink
url="../handbook/kernelconfig-building.html">Building and
Installing a Custom Kernel</ulink> chapter of the &os;
Handbook.</para>
</sect1>
</chapter>

View file

@ -297,62 +297,31 @@
</para>
<procedure>
<title>Procedure 1. Building a Kernel the <quote>Traditional</quote> Way</title>
<title>Building a Kernel</title>
<step>
<para>Run &man.config.8; to generate the kernel source code.</para>
<screen>&prompt.root; <userinput>/usr/sbin/config <replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>Change into the build directory. &man.config.8; will print
the name of this directory after being run as above.</para>
<screen>&prompt.root; <userinput>cd ../compile/<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>Compile the kernel.</para>
<screen>&prompt.root; <userinput>make depend</userinput>
&prompt.root; <userinput>make</userinput></screen>
</step>
<step>
<para>Install the new kernel.</para>
<screen>&prompt.root; <userinput>make install</userinput></screen>
</step>
</procedure>
<procedure>
<title>Procedure 2. Building a Kernel the <quote>New</quote>
Way</title>
<step>
<para>Change to the <filename>/usr/src</filename> directory.</para>
<para>Change to the <filename
role="directory">/usr/src</filename> directory:</para>
<screen>&prompt.root; <userinput>cd /usr/src</userinput></screen>
</step>
<step>
<para>Compile the kernel.</para>
<para>Compile the kernel:</para>
<screen>&prompt.root; <userinput>make buildkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>Install the new kernel.</para>
<para>Install the new kernel:</para>
<screen>&prompt.root; <userinput>make installkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
</procedure>
<note>
<para>This method of kernel building requires full source files. If you
only installed the kernel source, use the traditional method, as
described above.</para>
<para>It is required to have full &os; source tree to build the
kernel.</para>
</note>
<tip>