aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc
diff options
context:
space:
mode:
authorSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
committerSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
commit989d921f5d4ac8d8b7c831c13b8954ad1901be24 (patch)
treea5d768f9af4b55422fdf5b17064879ae1c7ce032 /documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc
parent0cff342f42461c5081b98bce7581f43df319e4f4 (diff)
Diffstat (limited to 'documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc')
-rw-r--r--documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc75
1 files changed, 75 insertions, 0 deletions
diff --git a/documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc b/documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc
new file mode 100644
index 0000000000..7322b4cab3
--- /dev/null
+++ b/documentation/content/en/books/developers-handbook/kernelbuild/chapter.adoc
@@ -0,0 +1,75 @@
+---
+title: Chapter 9. Building and Installing a FreeBSD Kernel
+authors:
+prev: books/developers-handbook/partiii
+next: books/developers-handbook/kerneldebug
+---
+
+[[kernelbuild]]
+= Building and Installing a FreeBSD Kernel
+:doctype: book
+:toc: macro
+:toclevels: 1
+:icons: font
+:sectnums:
+:sectnumlevels: 6
+:source-highlighter: rouge
+:experimental:
+:skip-front-matter:
+:xrefstyle: basic
+:relfileprefix: ../
+:outfilesuffix:
+:sectnumoffset: 9
+
+include::shared/mirrors.adoc[]
+include::shared/authors.adoc[]
+include::shared/releases.adoc[]
+include::shared/en/mailing-lists.adoc[]
+include::shared/en/teams.adoc[]
+include::shared/en/urls.adoc[]
+
+toc::[]
+
+Being a kernel developer requires understanding of the kernel build process. To debug the FreeBSD kernel it is required to be able to build one. There are two known ways to do so:
+
+The supported procedure to build and install a kernel is documented in the link:{handbook}#kernelconfig-building[Building and Installing a Custom Kernel] chapter of the FreeBSD Handbook.
+
+[NOTE]
+====
+It is supposed that the reader of this chapter is familiar with the information described in the link:{handbook}#kernelconfig-building[Building and Installing a Custom Kernel] chapter of the FreeBSD Handbook. If this is not the case, please read through the above mentioned chapter to understand how the build process works.
+====
+
+[[kernelbuild-traditional]]
+== Building the Faster but Brittle Way
+
+Building the kernel this way may be useful when working on the kernel code and it may actually be faster than the documented 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.
+
+[.procedure]
+. Run man:config[8] to generate the kernel source code:
++
+[source,bash]
+....
+# /usr/sbin/config MYKERNEL
+....
+
+. Change into the build directory. man:config[8] will print the name of this directory after being run as above.
++
+[source,bash]
+....
+# cd ../compile/MYKERNEL
+....
+
+. Compile the kernel:
++
+[source,bash]
+....
+# make depend
+# make
+....
+
+. Install the new kernel:
++
+[source,bash]
+....
+# make install
+....