Page MenuHomeFreeBSD

bsdinstall: Guard against invalid branch/revision
ClosedPublic

Authored by emaste on Jul 25 2025, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 7:24 AM
Unknown Object (File)
Sat, Oct 11, 7:24 AM
Unknown Object (File)
Sat, Oct 11, 7:24 AM
Unknown Object (File)
Sat, Oct 11, 12:07 AM
Unknown Object (File)
Fri, Oct 3, 5:29 PM
Unknown Object (File)
Fri, Sep 26, 5:22 PM
Unknown Object (File)
Thu, Sep 25, 8:44 PM
Unknown Object (File)
Wed, Sep 24, 6:28 PM

Details

Summary
I somehow ended up with a tree where make -V BRANCH and make -V REVISION
were broken, resulting in a FreeBSD-base.conf with a broken repo URL.
Check for BRANCH == RELEASE explicitly and emit a warning if BRANCH does
not match an expected case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This LGTM!

I wonder if anything else breaks due to an invalid BRANCH. It looks like usr.sbin/pkg/Makefile silently ignores an invalid branch and falls back to latest. I'm not sure if this behavior is intentional or not though.

I'll make sure to update the duplication of this logic in https://reviews.freebsd.org/D51516, unfortunately I don't think there's a way to avoid the duplication without rewriting the vm image build scripts to use bsdinstall.

This revision is now accepted and ready to land.Jul 25 2025, 3:25 PM