HomeFreeBSD

vmimage.subr: Fix when/where we fix up METALOG

Description

vmimage.subr: Fix when/where we fix up METALOG

We only need to check for unMETALOGed directories and sort the METALOG
file if we're using it, i.e. if we're doing a NO_ROOT build. This
non-NO_ROOT builds by no longer bogusly writing to /METALOG*.

We only need to add databases (spwd.db etc) to METALOG if we're doing
a pkgbase-enabled NO_ROOT build; but we should always do this before
creating the filesystem, not only if we installed extra packages (in
vm_extra_install_packages, where that code was erroneously placed).
This fixes non-cloud VM images, which in 15.0-BETA2 shipped without
password databases.

Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53194

Details

Provenance
cpercivaAuthored on Oct 19 2025, 12:27 AM
Reviewer
ivy
Differential Revision
D53194: vmimage.subr: Fix when/where we fix up METALOG
Parents
rGbcdef9d68a21: inline most of the considered lost condensation.
Branches
Unknown
Tags
Unknown