HomeFreeBSD

freebsd-update: refuse to operate on a pkgbase system

Description

freebsd-update: refuse to operate on a pkgbase system

FreeBSD-update is not compatible with packaged base.

PR: 282252
Reviewed by: bapt, markj (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47341

(cherry picked from commit cf1aba2857c1ec59c9a34d363cb18a61ffa34a10)

freebsd-update: improve pkgbase check

The previous version used a case-insensitive match (default for -x).
The presence of packages like freebsd-git-devtools and freebsd-ftpd
would falsely trigger the packaged base check.

Instead, just use pkg which /usr/bin/uname as a packaged base
indication. pkg uses /usr/bin/uname to determine ABI, so we can rely on
it existing. If it comes from a package then packaged base is in use.

Also, extend the check to all freebsd-update commands. It is easier to
just disallow all commands, and easier to test.

Reported by: Mark Millard
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47378

(cherry picked from commit 856e158dc4aa5e43f0f15fcd3089fc0d71861b0e)

Details

Provenance
emasteAuthored on Oct 30 2024, 7:15 PM
Reviewer
bapt
Differential Revision
D47341: freebsd-update: refuse to operate on a pkgbase system
Parents
rGfe019d5e443b: bhyve: TPM 2.0 emulation with swtpm
Branches
Unknown
Tags
Unknown