Solved How do I install the kernel sources after installation?

I recently happened upon a piece of software that requires the FreeBSD kernel source code to be installed to build. The issue is, the FreeBSD Handbook does not have instructions on how to install the kernel source code. The installer had a check box for it, but I left it unchecked as I figured that the kernel source code was only something that FreeBSD developers would be interested in.

Please help me install the kernel source code so that I can build and run this software. Thank you in advance.
 
Dear DesktopUser1,
the detailed information is a little bit hidden in https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html.
Below "23.5.3. Updating the Source" you will find a grey block "Obtaining the Source" with instructions.
Unfortunately that section is written for a UFS not ZFS based system....
so the docs return on zfs the following
mv: rename /usr/src to /usr/src.bak: Operation not supported

even when attempting a chflags -R noschg /usr/src

AND... things have moved on to git as well...
 
Unfortunately that section is written for a UFS not ZFS based system....
so the docs return on zfs the following
mv: rename /usr/src to /usr/src.bak: Operation not supported

even when attempting a chflags -R noschg /usr/src

AND... things have moved on to git as well...
Then do zfs rename instead.
  1. You can always use bsdconfig(8) after installation to download additional components.
  2. If you're on a RELEASE version, the easiest is to add src (or onlysrc/sys) to freebsd-update.conf(5) & then do a freebsd-update(8)fetch install. Then the sources are updated whenever you need to do freebsd-update. You can do that from crontab(5) (see freebsd-update(8)), ...
  3. or subscribe to freebsd-security-notifications & receive an e-mail whenever a security patch becomes available, or drag & drop the RSS newsfeed into your PIM application (or internet browser?): FreeBSD Security Advisories & Errata Notices (RSS feed)
  4. If you want to follow other source tree branches, e.g. -STABLE & don't want to contribute patches to commiters, you don't have to use the complex devel/git, but use net/gitup instead to download & update the sources (for svn(1) (aka Subversion it was net/svnup and the developer kindly wrote gitup(1) recently).
 
I recently happened upon a piece of software that requires the FreeBSD kernel source code to be installed to build. The issue is, the FreeBSD Handbook does not have instructions on how to install the kernel source code. The installer had a check box for it, but I left it unchecked as I figured that the kernel source code was only something that FreeBSD developers would be interested in.

Please help me install the kernel source code so that I can build and run this software. Thank you in advance.
This may be of help to others:

 
Back
Top