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.
 
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
 
All those version repositories can't be downloadable archives that are updated with the code commits?
If your system has migrated to pkgbase, one can install the updated source packages (archives) easily:
Code:
% pkg search -r FreeBSD-base FreeBSD-src
FreeBSD-src-15.1p2             System userland source code
FreeBSD-src-sys-15.1p2         System kernel source code

Even if the system hasn't migrated to pkgbase, one can pkg-fetch(8) the packages and untar(1) them individually:
Code:
% pkg  fetch  -r  FreeBSD-base  -o  /tmp  FreeBSD-src  FreeBSD-src-sys
# tar  xfC  FreeBSD-src-15.1p2.pkg  /

It seems other freebsd.org domains do not offer downloadable archives, but the FreeBSD Github mirror has this option.

For zip and tar.gz RELEASE archives look under https://github.com/freebsd/freebsd-src/tags
Code:
release/15.1.0-p2

    3 weeks ago aadd58d zip tar.gz

release/15.0.0-p12

    3 weeks ago 7b527b9 zip tar.gz

release/14.4.0-p8

    3 weeks ago 3de2d29 zip tar.gz

STABLE and CURRENT (a.k.a "main") zip archives ( RELEASE also) are downloadable through the green "Code" button from the freebsd-src repository page. The branch can be selected with the "Switch branches/tags" button (located on the opposite side of the "Code" button).

By the way, latest and quarterly freebsd-ports archives are also available.
 
If your system has migrated to pkgbase, one can install the updated source packages (archives) easily:
Code:
% pkg search -r FreeBSD-base FreeBSD-src
FreeBSD-src-15.1p2             System userland source code
FreeBSD-src-sys-15.1p2         System kernel source code

Even if the system hasn't migrated to pkgbase, one can pkg-fetch(8) the packages and untar(1) them individually:
Code:
% pkg  fetch  -r  FreeBSD-base  -o  /tmp  FreeBSD-src  FreeBSD-src-sys
# tar  xfC  FreeBSD-src-15.1p2.pkg  /

It seems other freebsd.org domains do not offer downloadable archives, but the FreeBSD Github mirror has this option.

For zip and tar.gz RELEASE archives look under https://github.com/freebsd/freebsd-src/tags
Code:
release/15.1.0-p2

    3 weeks ago aadd58d zip tar.gz

release/15.0.0-p12

    3 weeks ago 7b527b9 zip tar.gz

release/14.4.0-p8

    3 weeks ago 3de2d29 zip tar.gz

STABLE and CURRENT (a.k.a "main") zip archives ( RELEASE also) are downloadable through the green "Code" button from the freebsd-src repository page. The branch can be selected with the "Switch branches/tags" button (located on the opposite side of the "Code" button).

By the way, latest and quarterly freebsd-ports archives are also available.
You basically have nothing and argue that git repositories are archives?
Archive files could be direct mirrors of these repositories. You only have to keep on updating it with the latest changes, like adding files to a tar. This is a problem?

I used the ftp src.tar.gz often for a long time, but that can be weeks old. The freebsd.org ftp-server seems to have stopped responding Probably for not having transfer encryption.

I think people trying out FreeBSD for whatever reason should not be "encouraged" to use outdated system source files by putting up an update standard that requires this amount of time to set up. Download, compile and install should be a few lines and automatically involve recent files.
 
You basically have nothing and argue that git repositories are archives?
Archive files could be direct mirrors of these repositories. You only have to keep on updating it with the latest changes, like adding files to a tar. This is a problem?

I used the ftp src.tar.gz often for a long time, but that can be weeks old. The freebsd.org ftp-server seems to have stopped responding Probably for not having transfer encryption.

I think people trying out FreeBSD for whatever reason should not be "encouraged" to use outdated system source files by putting up an update standard that requires this amount of time to set up. Download, compile and install should be a few lines and automatically involve recent files. Git and gitup work and are close to the same result but not parts of the system.
 
You basically have nothing and argue that git repositories are archives?
Archive files could be direct mirrors of these repositories. You only have to keep on updating it with the latest changes, like adding files to a tar. This is a problem?

Hmm ..., there seems to be a misunderstanding. You asked for
All those version repositories can't be downloadable archives that are updated with the code commits?
That's exactly what's on the FreeBSD Github repository offered for download: source code, updated with the (latest patch level) code commits, in .zip and .tar.gz archive file format:

15.1-RELASE-p2 (zip, tar.gz):
https://github.com/freebsd/freebsd-src/archive/refs/tags/release/15.1.0-p2.zip .
https://github.com/freebsd/freebsd-src/archive/refs/tags/release/15.1.0-p2.tar.gz .

16-CURRENT (zip): https://github.com/freebsd/freebsd-src/archive/refs/heads/main.zip
15.1-STABLE (zip): https://github.com/freebsd/freebsd-src/archive/refs/heads/stable/15.zip
 
Back
Top