From nobody Tue Sep 22 00:19:10 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hpgh374X8z6sRPc for ; Tue, 22 Sep 2026 00:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hpgh35jjSz4CMc for ; Tue, 22 Sep 2026 00:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790036355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kEG5r9//8d0JX02Q24sXkZNEDZxB532eoBs1bPpl3KE=; b=vFAo6BCHgvm5JuSMcK9NeyeeH2NfwfqmMXf5Rk35UFFboW1YWciq1ypf2mp+Q/fZ1l5KZ/ 3FhK6+6HeoxHBQ9Fef3xxIS+o1dP8vMtoxzpvxCmym6taeBL+H8uxPSee5MvMZtUChsQUv +Q3TFtJpzU4qm+irWVBf4e7VLwWDZX5s68HfP2JdcNv8ngkhH5uc2OAvUp5LMN7eU1x2nW ZU56bkKNeszb3hcijB9SF6gj3Y7eUIJ8KPPpmHSb/J0qd0uOFytira2k4HUBvA+zgFCeZK 7GyH3HQK5/XvYS+HGWnKVN27XN4vC4Fc+GAl1/hNPjxIK7O0jpENiXYHCccECw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790036355; b=SY1LfsnrxATwHVUXD5lokl0E1be9Z+4lXeirHYoEXOmTaMFizeikdwYTGhdBWu4LHKsrTW oVdZ1ghK3kl7/vw3Tlzq1FfXguo1nvJxs6IgQOfjO6jH7RpCkDMqQgpxQXP/+0T0iZfPKv kKCR+pAeq+1dvzQmvUKj1WaVctNrgcC+KJZ+XVB/OA1md/1Lft/yZIb/SUnifqvZK5Gqx+ c7NtCdLB7wrNTjwNogyhFFTQYjJgQNYpwPv//gSN0MUaDP4LoFffBjOwF4S/x7a6esoarr EKMFxwtWcFxgwv1IHVTSEG+n8OZE0ZbR+xn13XSVWtwd4eeN4e9Mv5clP27cvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790036355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kEG5r9//8d0JX02Q24sXkZNEDZxB532eoBs1bPpl3KE=; b=LRLDVUe6/PPEurIBP01ipQ+AM+oHLT4q2YXcmUQIvsuocIw70gZ6RQDE7ekKs3vRx+eCWX Tm5TSVbrDaC7IBin4X98dNOuYw/97mSK8Ga79JyCOmyzQnmLmfYB1GsNd/E42Z/v64YEok z6Iq7wqQPVzF0tzy5ZPpXUlPvPJ5wtjFVdsqjHT07x1weqARkv/KOdEyuaCEJnmTPKLKlB u8j6dyfKM69wdVJp5wulOatJE/BmK99zCiRAEH7aOkbY52bT4LJ9+JrShzay10DaRKloeX 6Kek9Zc8SuliTMDoSCin+UWI/CD0RWflYHqppw3VaYG/pePl17iBNKLVbZ1ulw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hpgh34p6kzkHQ for ; Tue, 22 Sep 2026 00:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41a42 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 22 Sep 2026 00:19:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 5a2328a17851 - main - vmimage.subr: Include dangling symlinks in images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a2328a17851ac609ab6c786d9b0db388f15e6b3 Auto-Submitted: auto-generated Date: Tue, 22 Sep 2026 00:19:10 +0000 Message-Id: <6ab1c97e.41a42.5cd7b4ce@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5a2328a17851ac609ab6c786d9b0db388f15e6b3 commit 5a2328a17851ac609ab6c786d9b0db388f15e6b3 Author: Colin Percival AuthorDate: 2026-09-22 00:08:26 +0000 Commit: Colin Percival CommitDate: 2026-09-22 00:19:01 +0000 vmimage.subr: Include dangling symlinks in images When creating VM images, we filter the METALOG file created by pkg(8) when installing non-base packages, rejecting any lines which correspond to files which don't exist; this solves a problem which arose when a package was installed and then deinstalled (or upgraded) later in the image-building process. Unfortunately [ -e ... ] follows symlinks and is not basedir-aware, so an absolute symlink which is valid *inside* the image is omitted from the image if it points to something which isn't present in the build host system. Replace [ -e ... ] with [ -e ... ] || [ -L ... ] so that symlinks are included even if dangling. While I'm here, add quoting in case future paths become problematic. Sponsored by: Amazon MFC after: 3 days --- release/tools/vmimage.subr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index f06bf4848cb8..b8d2be965dde 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -266,7 +266,8 @@ buildfs() { # have been logged which no longer exist if a package was removed. if [ -f ${DESTDIR}/METALOG.pkg ]; then while read F REST; do - if [ -e ${DESTDIR}/${F} ]; then + if [ -e "${DESTDIR}/${F}" ] || + [ -L "${DESTDIR}/${F}" ]; then echo "${F} ${REST}" >> ${DESTDIR}/METALOG fi done < ${DESTDIR}/METALOG.pkg