FreeBSD source code: how to locally download it

Hello guys !!
One of the great things about FreeBSD is that you can take a look at the source code.

Please, can you tell me how can I dowload the source code on my workstation for the RELEASE 11.1 that I actually use ?

Thanks in advance.
 
There are some options, I prefer using subversion, see Updating the Source

In your case, you'd go to /usr/src and do svn checkout https://svn.freebsd.org/base/releng/11.1 . (or maybe pick a different mirror). This will checkout the most recent patchlevel (atm -p10).
 
Handbook

really, read it, it's short and well written and covers both kinds of Source

World is the base installation (poster above showed you). Ports are any software outside that. The source for these is handled separately and slightly differently. easy examples are in the Handbook.
 
This is how I download and update the source code on FreeBSD 12.1 with svn [they say not to use two different methods.]

Update /usr/src tree
********************
[To remove the source tree delete the contents of /usr/src including the .svn directory.]

Use:
uname -r to find out your version number

Create the source tree with svn with this command [assuming we are using FreeBSD 12.1-RELEASE]:
sudo svn checkout https://svn.freebsd.org/base/releng/12.1 /usr/src

If we were using the CURRENT version we would use this command [as of this writing it is version 13-CURRENT]:
sudo svn checkout https://svn.freebsd.org/base/head /usr/src

You can view the different source trees available here:

Update the source tree with this command:
sudo svn update /usr/src
 
Back
Top