How do I install FreeBSD kernel source code?

Posted on in Categories last updated June 30, 2007

Q. I need to configure FreeBSD kernel but not able to find out source code in /usr/src/sys directory. How do I install FreeBSD source code?

A.Your kernel and all related source code is located at /usr/src/sys directory which is also accessible through the /sys path.

If there is not a /usr/src/sys directory on your system, then the kernel source has not been installed. The easiest way to do this is by running sysinstall as root, choosing Configure, then Distributions, then src, then base and sys
# sysinstall
sysinstall-1.jpg

Select Configure
sysinstall-2.jpg
Select Distributions
sysinstall-3.jpg
Select src
sysinstall-4.jpg
Then base and sys > Select ok
sysinstall-5.jpg

Further readings

make buildworld cd: can’t cd to /usr/src/tools/build/make_check Error and Solution

Posted on in Categories , , , , last updated June 7, 2009

‘m trying buildworld under FreeBSD operating system. But I’m getting an error which read as follows:

————————————————————–
>>> Building an up-to-date make(1)
————————————————————–
cd: can’t cd to /usr/src/usr.bin/make
*** Error code 2

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.

How do I fix this problem?