Is my /usr/src kept up to date?

Some time last year I ran into an issue that was solved by having the FreeBSD source in /usr/src. I can't remember what the issue was but extracting the source in that dir solved it.

Now, I have this source sitting there but it looks as if it's not kept up to date, at least not always. The last update seems to be April 2020 if I go by the timestamp on the files as the file UPDATING has that as its date. Most files date back to November 2019. src.txz has a timestamp of 14 March 2020. I have recently installed 12.1-p8 and 12.1-p9 just a few days ago, using freebsd-update(8).

Isn't freebsd-update(8) supposed to also keep the source up to date?

I did, at one point, try to use svn to keep it up to date. That was before I understood that freebsd-update(8) kept the source updated. Did that mess something up? I have never touched freebsd-update.conf and that still says
Code:
Components src world kernel
so it should update source, correct?
 
Either user freebsd-update(8) or svn, not both. You've ruined your /usr/src. rm -fr /usr/src it and start from scratch.

For future only perform one of these method, not both

>> METHOD 1: svnlite(1) or devel/subversion:
/etc/freebsd-update.conf
Code:
Components world kernel
First time:
svn checkout https://svn.freebsd.org/base/releng/12.1 /usr/src
Update:
svn update /usr/src

>> METHOD 2: freebsd-update(8)
/etc/freebsd-update.conf
Code:
Components src world kernel
For update:
freebsd-update fetch install

** First you need to extract src to /urs/src
You can find src.txz for different version here:
tar -C / -xf src.txz

[EDIT] I'm not familiar with git mechanism for checkout/update src. I hope somebody shine some light on subject with his comment. Thanks!
 
One thing, though. That tarball at http://ftp-archive.freebsd.org/pub/FreeBSD/releases/amd64/12.1-RELEASE/src.txz is from almost a year ago. If I extract that and subsequently run freebsd-update will it then be updated to the latest source, RELEASE12.1-p9?
Why bother, download the latest available source:

Look for the "Code" marked green button, download zip file.
 
OK, I have now used the p9 version as a Zip from Github. That works (though it takes some tries to get the actual URL to feed to curl).

For future occasions, is there also a link to the src.txz file of the latest version somewhere? Instead of getting the zip from Github? A link to a 'RELEASE-12.1-p9.txz', a '/releases/12.1-p9/src.txz' or perhaps a 'latest.txz'?
 
OK, I have now used the p9 version as a Zip from Github. That works (though it takes some tries to get the actual URL to feed to curl).

Have you used curl -LO ... ? fetch(1) works good as well.
For future occasions, is there also a link to the src.txz file of the latest version somewhere? Instead of getting the zip from Github? A link to a 'RELEASE-12.1-p9.txz', a '/releases/12.1-p9/src.txz' or perhaps a 'latest.txz'?

There are no latest snapshots for releng src, at least I'm not aware of such. Only -STABLE or -CURRENT get those src.txz snapshots once a week, together with base and kernel and the other set of packages. The latest src snapshot for releng as a compressed file you get only from GitHub. Does it make a difference if the file is from GitHub? FreeBSD on GitHub is a official mirror.
 
I'm not thinking of snapshots. I'm thinking of a URL to a src.txz that just contains the latest stable release. Today that file would contain p9, in six weeks that file might contain p10.

It would mean that you could use that in a script and be sure that it always downloads the most recent stable source code instead of having to change the script on every new release.
 
There is a chapter in the handbook on updating the source as well:
FreeBSD source code is located in /usr/src/. The preferred method of updating this source is through the Subversion version control system.

 
Back
Top