Page MenuHomeFreeBSD

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

Authored by cperciva on Oct 19 2025, 12:34 AM.
Tags
None
Referenced Files
F137875250: D53194.id164538.diff
Wed, Nov 26, 6:04 PM
Unknown Object (File)
Sat, Nov 22, 2:01 PM
Unknown Object (File)
Thu, Nov 20, 11:46 PM
Unknown Object (File)
Wed, Nov 19, 6:03 AM
Unknown Object (File)
Tue, Nov 18, 4:30 AM
Unknown Object (File)
Sun, Nov 9, 11:19 AM
Unknown Object (File)
Thu, Nov 6, 11:04 PM
Unknown Object (File)
Sun, Nov 2, 2:24 PM
Subscribers

Details

Summary

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.

MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva

Diff Detail

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

Event Timeline

release/tools/vmimage.subr
302

is there any harm in doing this anyway for a non-pkgbase build? or is it handled somewhere else in that case?

release/tools/vmimage.subr
302

For a non-pkgbase install this is handled by code in various Makefiles, e.g. https://cgit.freebsd.org/src/tree/lib/libc/gen/Makefile.inc#n584

It would be sort of harmless to include here anyway since we're going to remove duplicate lines, but for clarity I'd prefer to only add the lines when needed.

ivy added inline comments.
release/tools/vmimage.subr
302

okay, that seems reasonable.

This revision is now accepted and ready to land.Oct 19 2025, 4:17 PM