.org> Subject: git: 8d2dcf925d33 - releng/15.0 - vmimage.subr: Add missing directories to METALOG 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 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: 8d2dcf925d335e29dcc1699e08a33bbd8102a833 Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2dcf925d335e29dcc1699e08a33bbd8102a833 commit 8d2dcf925d335e29dcc1699e08a33bbd8102a833 Author: Colin Percival AuthorDate: 2025-10-17 07:01:33 +0000 Commit: Colin Percival CommitDate: 2025-10-17 16:53:40 +0000 vmimage.subr: Add missing directories to METALOG Theoretically METALOG should include everything which needs to go into disk images; unfortunately there are still a few bugs which are resulting in directories not being listed -- and if METALOG has files in unrecorded directories, the directories end up being created with 000 permissions. Oddly enough, systems where / has 000 permissions are not very usable. As a temporary hack, compare the staging tree against METALOG and add entries for any unrecorded directories. This will hopefully be reverted before 15.0-RELEASE. Approved by: re (cperciva) Reviewed by: bapt, emaste, ivy Sponsored by: https://www.patreon.com/cperciva MFC after: 5 minutes Differential Revision: https://reviews.freebsd.org/D53153 (cherry picked from commit 71b2f9853529b1d1a160eaaa202e93a14f91eed1) (cherry picked from commit 7ce5d908fd6b51dc89d9b89f4c009e44cb932b55) --- release/tools/vmimage.subr | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index c3c917dcd642..842a808c623e 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -290,6 +290,24 @@ buildfs() { cat ${DESTDIR}/METALOG.pkg >> ${DESTDIR}/METALOG fi + # Check for any directories in the staging tree which weren't + # recorded in METALOG, and record them now. This is a quick hack + # to avoid creating unusable VM images and should go away once + # the bugs which produce such unlogged directories are gone. + grep type=dir ${DESTDIR}/METALOG | + cut -f 1 -d ' ' | + sort -u > ${DESTDIR}/METALOG.dirs + ( cd ${DESTDIR} && find . -type d ) | + sort | + comm -23 - ${DESTDIR}/METALOG.dirs > ${DESTDIR}/METALOG.missingdirs + if [ -s ${DESTDIR}/METALOG.missingdirs ]; then + echo "WARNING: Directories exist but were not in METALOG" + cat ${DESTDIR}/METALOG.missingdirs + fi + while read DIR; do + metalog_add_data ${DIR} + done < ${DESTDIR}/METALOG.missingdirs + # Sort METALOG file; makefs produces directories with 000 permissions # if their contents are seen before the directories themselves. env -i LC_COLLATE=C sort -u ${DESTDIR}/METALOG > ${DESTDIR}/METALOG.sorted