Bug 282252 - freebsd-update must refuse to run on a pkgbase system
Summary: freebsd-update must refuse to run on a pkgbase system
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: pkgbase
Depends on:
Blocks:
 
Reported: 2024-10-21 15:41 UTC by Ed Maste
Modified: 2024-11-12 13:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2024-10-21 15:41:46 UTC
pkgbase is not compatible with freebsd-update. We need freebsd-update to detect when  pkgbase is in use, and exit with an error.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2024-10-30 17:47:39 UTC
Draft/sketch of a patch in https://reviews.freebsd.org/D47341
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-31 18:36:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf1aba2857c1ec59c9a34d363cb18a61ffa34a10

commit cf1aba2857c1ec59c9a34d363cb18a61ffa34a10
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-10-30 19:15:13 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-10-31 18:35:44 +0000

    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

 usr.sbin/freebsd-update/freebsd-update.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-11-12 13:41:42 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=094a5146dff465622640cd2ec40a13451a0e6598

commit 094a5146dff465622640cd2ec40a13451a0e6598
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-10-30 19:15:13 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-11-12 13:40:05 +0000

    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)

 usr.sbin/freebsd-update/freebsd-update.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)