aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2025-10-10 22:01:38 +0000
committerColin Percival <cperciva@FreeBSD.org>2025-10-11 00:02:34 +0000
commit6081365c27e68707ad25c98159e364ee90fcf5db (patch)
tree62027e557119177569c5bea9c64de0ea0a5a9af8
parent7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e (diff)
vmimage.subr: metalog_add generated databases
The files /etc/login.conf.db, /etc/passwd, /etc/pwd.db, /etc/spwd.db, and /var/db/services.db are generated at install time. When VM images are built using installworld, there is Makefile code which emits the necessary METALOG lines; but the pkgbase triggers do not do this. This resulted in VM images which lacked these essential database files. VM images are currently the only place where this matters, since this issue is specific to non-root image builds uusing pkgbase. (In some point in the future we will start building release ISO iamges from pkgbase, at which point it will be a problem there as well.) The long-term solution for this is probably to teach the relevant database-creating tools to emit METALOG lines; but for now, just log the necessary files from vmimage.subr. Reviewed by: dch MFC after: 5 minutes Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D53034
-rw-r--r--release/tools/vmimage.subr10
1 files changed, 10 insertions, 0 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 067eb5ea48a8..15c4dd53e70b 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -213,6 +213,16 @@ vm_extra_install_packages() {
install -y -r ${PKG_REPO_NAME} $pkg
done
metalog_add_data ./var/db/pkg/local.sqlite
+
+ # Add some database files which are created by pkg triggers;
+ # at some point in the future the tools which create these
+ # files should probably learn how to record them in METALOG
+ # (which would simplify no-root installworld as well).
+ metalog_add_data ./etc/login.conf.db
+ metalog_add_data ./etc/passwd
+ metalog_add_data ./etc/pwd.db
+ metalog_add_data ./etc/spwd.db 600
+ metalog_add_data ./var/db/services.db
else
if [ -n "${WITHOUT_QEMU}" ]; then
return 0