Shortest source update requirements.

I lost track of how gitup works or it has changed and no longer works in my build chroot. I don't like spending time on this. It tries 15.0 on a 15.1 kernel... What's the most simple way to get the latest FreeBSD 15.1 source tree?
 
If you are running pkg base, install the relevant pkgs (src or sys only).
The upside is that it will always match the running kernel, the downside is that if you are on stable/current there's a lot of churn.
 
If you want to use gitup for this, edit /usr/local/etc/gitup.conf and replace "branch" : "releng/15.0", with "branch" : "releng/15.1", (this is under the top level "release" entry) and then do "gitup release".
 
Install one of the following devel/git flavors, listed by number of dependencies. Top listed: most, bottom listed: least.

Code:
git        Distributed source code management tool
git-lite   Distributed source code management tool (lite flavor)
git-tiny   Distributed source code management tool (tiny flavor)
List dependencies: pkg rquery %dn <git_flavor>

Proceed with FreeBSD handbook, 27.7. Updating FreeBSD from Source, chapter 27.7.3. Updating the Source:
Code:
# mv /usr/src /usr/src.bak
# git clone --branch releng/13.2 https://git.FreeBSD.org/src.git /usr/src
Obviously replace unsupported version from the handbook example with a supported version.
 
Code:
# mv /usr/src /usr/src.bak
This might not work if you have a ZFS system, /usr/src/ is a separate dataset and you cannot rename it this way. I'd just nuke it, no reason to keep a 'backup' of it, rm -rf /usr/src/* /usr/src/.[^.]*
 
This might not work if you have a ZFS system, /usr/src/ is a separate dataset and you cannot rename it this way. I'd just nuke it, no reason to keep a 'backup' of it,
Absolutely (I just copy&paste'ed the whole procedure, including the "mv" line, from the handbook).

I myself use "src" ZFS datasets, ZFS clones of the (Git cloned) "main" branch source dataset to be exactly, to create different branch source directories. Currently stable/15, which I use from time to time to test a wifi driver in a boot environment, is missing.
Code:
% zfs list | grep src
zroot/usr/src-15.1                     256M  5.74G  3.09G  /usr/src-15.1
zroot/usr/src-main                    3.32G  5.74G  3.14G  /usr/src-main
Separate branch src directories create separate build /usr/obj directories (/usr/obj/usr/src-15.1/), which is easier to maintain instead of using /usr/src only, which would required every time the branch changes to buildworld|kernel again and again. Separating src directories is also particularly useful when using WITH_META_MODE.

When I'm done with a branch, that dataset is destroyed.
 
If you want to use gitup for this, edit /usr/local/etc/gitup.conf and replace "branch" : "releng/15.0", with "branch" : "releng/15.1", (this is under the top level "release" entry) and then do "gitup release".

If forgot that. It's pretty important. Can't it just assume the currently running release string by default?

It still works with git too . But why is there no freebsd.org page that contains the last accepted kernel and base source? It's like 2GB... I'm usually working on offline projects so I don't really need to cover the latest vulnerabilities per week but it doesn't look significant either. Providing a most up-to-date source tree should not come with technical barriers. It's a directory with text files.
 
I've followed the way documented here (chapter 5.2.2) when I've switched from subversion to git (chase the decision of FreeBSD project) to clone src and ports.

This was because the description in the Handbook was NOT yet ready at the moment. (To be honest, what I've followed was the draft of the linked document, as official one was not yet ready, too.)

A difference is that I've already used Root on ZFS, but not created by the installer (bsdinstall), and as git wanted blank /usr/src and /usr/ports respectively, I've done the undocumented way like below.
  1. To be paranoid, created /usr/src-snv and /usr/ports-svn as temporary mount point.
  2. Unmounted /usr/src and /usr/ports with zfs umount.
  3. Change mountpoint of prior src and ports datasets to the temporary ones.
  4. Created new dataset src-git and ports-git under the parent datasets of each, with mountpoints /usr/src and /usr/ports respectively.
  5. Cloned src and ports repo as described in above-linked git primer.
  6. Once confirmed the new /usr/src and /usr/ports OK, destroyed former src and ports datasets and removed the temporary mount point.
Note that I'm not a committer, so followed clone part and confirmation part (the first 2 parts) only.

After the clones are finished, both repos are pointing at the head (top) of main branch in each repo. For me, ports repo is OK as-is. So as my test environments for main (aka -CURRENT) in another physical drive.

But for my daily driver (latest stable branch), it's not appropreate.

So checked out the wanted branch. This can be appricable when switching to different branch. As I cannot recall at which branch it actually was, example below is to checkout releng/15.1, which is used for 15.1-RELEASE.
cd /usr/src && git checkout releng/15.1
 
Back
Top