git: 7ca0c1eba2e4 - main - vmimage.subr: Use makefs -N

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 02 Sep 2026 16:45:10 UTC
The branch main has been updated by cperciva:

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

commit 7ca0c1eba2e4c49ac92499ef0f6adf27c8b930d4
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-09-02 16:37:58 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-09-02 16:37:58 +0000

    vmimage.subr: Use makefs -N
    
    By default, makefs uses the host environment's user and group databases
    when creating filesystems.  This causes makefs to fail when trying to
    create files owned by users or groups which don't exist in the host
    environment, for example when creating a VM with packages pre-installed
    which added their own users/groups.
    
    Pass "-N ${DESTDIR}/etc" to makefs to point it at the user and group
    databases from the image being created.
    
    MFC after:      1 week
    Sponsored by:   Amazon
---
 release/tools/vmimage.subr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 462f0653f8a4..f06bf4848cb8 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -404,7 +404,7 @@ vm_create_disk() {
 		WITH_UNIFIED_OBJDIR=yes \
 		make -C ${WORLDDIR}/stand -V .OBJDIR)"
 	BOOTFILES="$(realpath ${BOOTFILES})"
-	MAKEFSARGS="-s ${VMSIZE} -D"
+	MAKEFSARGS="-s ${VMSIZE} -D -N ${DESTDIR}/etc"
 
 	case "${TARGET}:${TARGET_ARCH}" in
 		amd64:amd64 | i386:i386)