From nobody Sun Nov 16 03:12:09 2025 X-Original-To: dev-commits-src-branches@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 4d8GBg3Pdxz6Gpvl; Sun, 16 Nov 2025 03:12:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d8GBf1Tygz3njc; Sun, 16 Nov 2025 03:12:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763262730; 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=h7y6SxUb3cFnb0lDOZZrxD9W4tE+406r40SUOPJJCao=; b=fVEDLv1yJ7RAm523PhJDIC9jRP8coWhssJKLncHJuoIp+GxaccI7vLCIzPnrqHpcuyZkIX KqQNrVfHNoGhjdFZ8bDn5c+LpvuL1DtHR+a2vBCWYHFEqSq6JIMJWTItw/jDzAYFm0FTjK 2mUJ5MZ8GZ6x3Xpvtn5VKN7hXTuykz5a2BN2vuh3BKmXbdmFuyM+r34pXDJS8oVB6BrXKV FaxY78FnobG6eC7AiC/iKg8lOdlxhZJY47yxA7kAJ0HaPqX77BEXZVq0jlcJ/dgWLef2s2 Cf/qgxhtBEud6xBeT9+CU+s/MfQpRC8oDYvS/9VYxctPfbRGwytaPrHBZ9jv/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763262730; 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=h7y6SxUb3cFnb0lDOZZrxD9W4tE+406r40SUOPJJCao=; b=DXIC0r48iVw7skzJQ9UojjNQRRS+Y/Z0J1O/T6liEFqoSYahchBvcCuoywBy+yfPYCCJkz Pi1hCy7yVqUH5IGgKHN5oX+32DVODei++MXgwy2sa3e3G8+pW/3kjBpd2MUXBy/CJ9wp2e rbRtx2Y1o6PcKA66j6jezEN9ocedOP7+LkfQtzWnPleDxvegurDwPlDpf7RlKm2ZUJaLOE Ap+G3JFXWDoBK3WffLxnS5G8FnteZRbEC7rMwqW6l7uVjD5Ctk8aO1t4EOqtvj+CIXegTN 9TjEvTxLXEeDtifcWAzFo9jgGWsp7/Hpe2nIqQXpxhA9Lw8+cEKbK89kKSNgCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763262730; a=rsa-sha256; cv=none; b=xkUiSLoR3ctR7VpymAjMk6IHI7S4Roy8yX1Yauhlfxw46j9KOHgCqi0if85AFWWZX1aZFi 9p3qd9HMj/A0dR/I9pahKtnQjt1KfD/E0PzaZc6M4gZ+yv/vPIpB2O6xllvUvUPTiwfZVs YOqzC9Bx/aQYC7cteLcvc6zkk/k3G9e2SgjugnP8DfAXl+5Sffeau8CsiKEROI1QiC/HZI VbruAI2NdxqwNNHJSYBIDaN12cnpypJ6gTp3zTgRFBSB2u/c6BmQNrvDtmuzI1xGqY2IXR zM5lPbGPGuc6n+bawfKd2q9LFQihb8mOuoDrP8+kZLnNhmjeip3F12SRJkdHaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d8GBd4ljVz5R7; Sun, 16 Nov 2025 03:12:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5AG3C9oZ094509; Sun, 16 Nov 2025 03:12:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AG3C9M7094506; Sun, 16 Nov 2025 03:12:09 GMT (envelope-from git) Date: Sun, 16 Nov 2025 03:12:09 GMT Message-Id: <202511160312.5AG3C9M7094506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 1ef6b8e0683a - releng/15.0 - vmimage.subr: Don't log missing files from pkgs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 1ef6b8e0683a63c805b33816e4ad460b4e5e158e Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1ef6b8e0683a63c805b33816e4ad460b4e5e158e commit 1ef6b8e0683a63c805b33816e4ad460b4e5e158e Author: Colin Percival AuthorDate: 2025-11-16 01:19:50 +0000 Commit: Colin Percival CommitDate: 2025-11-16 03:11:26 +0000 vmimage.subr: Don't log missing files from pkgs When installing "extra" packages (aka those built from the ports tree), we record everything being installed in METALOG.pkg; the contents of that file is appended to METALOG before we generate the filesystem. There are two cases when files recorded in METALOG.pkg will no longer exist by the time we create the final disk image: 1. If a pkg bug results in false dependencies being installed which are later removed by "pkg autoremove", and 2. If the pkg we build and install from /usr/ports is older than the pkg on pkg.freebsd.org, and pkg gets upgraded automatically as part of installing extra packages. The ultimate issue in both cases is that there's no mechanism for removing entries from METALOG when we run 'pkg delete'. Address this build breakage by checking, line by line, if filesystem objects mentioned in METALOG.pkg exist before appending them to METALOG. Approved by: re (cperciva) Fixes: 6a13aeac3c1f ("vmimage.subr: pkg autoremove after pkg install") MFC after: immediately (needed for 15.0-RC1) (cherry picked from commit 78fa6965e91ec52c24f602250a9d7ec465b9a6ba) (cherry picked from commit 0ff7c9251790117429d1d04d75ec75585878325d) --- release/tools/vmimage.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 7035b107ae22..03d92850f2a3 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -292,8 +292,15 @@ vm_extra_pkg_rmcache() { buildfs() { local md tmppool + # Copy entries from METALOG.pkg into METALOG, but first check to + # make sure that filesystem objects still exist; some things may + # have been logged which no longer exist if a package was removed. if [ -f ${DESTDIR}/METALOG.pkg ]; then - cat ${DESTDIR}/METALOG.pkg >> ${DESTDIR}/METALOG + while read F REST; do + if [ -e ${DESTDIR}/${F} ]; then + echo "${F} ${REST}" >> ${DESTDIR}/METALOG + fi + done < ${DESTDIR}/METALOG.pkg fi if [ -n "${NO_ROOT}" ]; then