KIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760507850; 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=lN5UcdLhcu8EkuOWN0CntqomebNa787JLConSA+BiGg=; b=J4Eyzrj3G/+v3H1tvC+mjmQJYEcOQUJdCVAm6uJzgnYLsMZr7njBqGMyqK3Mqta3FrwW8a I30v1jKls9m9avdQ3vPDseFFoyP/5VzGVcDyDzvGij2DewPDyRYCHT/wue/9SVTPeHwRpX A4xJqDCkYdEAV9vvA872/JlhVn/h4IB8aAero54VnjK4CvGdAAP10w0x+MpHas2XEhIoRU iOzrcwM8ZLEvCQcbbuCKpIQrTwaiSNtmRGzUpyrXLlvWlkpdWlM7r1brH5lkRfivb6QbJ2 78XbtxYeb2FjTYWqRjIJ8TBSYE3a8Nbet0uKp8/lnlxBn4jFQlvCtyNU/EF+sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760507850; 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=lN5UcdLhcu8EkuOWN0CntqomebNa787JLConSA+BiGg=; b=BNBo9iceQlWmnQFRc1bZpJkWPLEumjQ5zoGV7awEOtDZVMqZTCGFpYD9nVo1bZsgGlw/Bd Ey1UVFptodd4S+MfeYjLf3l5XeFktNBzGTrbOkS9G3/G4XoQuSzoDVDe9bb3nK/hsSJzzV Axq16T+ltuQFYhHlJdGQZd+dEJ5rDfJ4SEgVg/G5+GtokVKwicPcLPy1LvEbFXEybXvKKL 8eb2J6UCG6vI8l8hCPmCeJxjzV33P7oYZXrDgViyeeCOeNOS0DG5kT/qhID7psELnqISjU G/Y0e/wlSqenDBkYyrO3Q9a56gBneYJig323D6ihCORMdEJ6fq1Xud0XLzx+4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760507850; a=rsa-sha256; cv=none; b=b6yfW48HEHSMT9ioN1s9tIk4EPNW7+bipNFFA/0ILt86pp1Y68z2MdN5GGf1hls5IsLhKv Gsfhd4yZ25E02d52J0CJvmLSF6SnCoTCsLsOgfjCYQhpfC8WwlK/LijkXTNEtO6p6aPzLR up3wO5ivjEv1go5yQ0VWljy4aSqyM7qckuGN2YRcARgJbeQ4i6Y6ARsStY/JOlIW+tXqYR BJ4bMFEDnSjjxPzbGEqEE0HXLtJ5q2vPLjS+Z/6gXYnUyGyZ7J844FE+/negKVhWGinmcf o/66LvvOb+nm3Y9JQCBGvzIHmyXV8vlsqND09+yMfXj5/Nggy+6ODIcsz2RxMA== 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 4cmgNB0wNnz9Wl; Wed, 15 Oct 2025 05:57:30 +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 59F5vTUk002800; Wed, 15 Oct 2025 05:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59F5vT4N002797; Wed, 15 Oct 2025 05:57:29 GMT (envelope-from git) Date: Wed, 15 Oct 2025 05:57:29 GMT Message-Id: <202510150557.59F5vT4N002797@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: ad2ca1c5c179 - stable/15 - vmimage.subr: Sort METALOG before running makefs 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/stable/15 X-Git-Reftype: branch X-Git-Commit: ad2ca1c5c17935d8601b3ee48f705e1e5ede57bc Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=ad2ca1c5c17935d8601b3ee48f705e1e5ede57bc commit ad2ca1c5c17935d8601b3ee48f705e1e5ede57bc Author: Colin Percival AuthorDate: 2025-10-12 04:32:29 +0000 Commit: Colin Percival CommitDate: 2025-10-15 05:57:20 +0000 vmimage.subr: Sort METALOG before running makefs When creating VM images from pkgbase, the METALOG may not be in order; in particular, files may be listed before the directories which contain them. This causes makefs to create directories with 000 permissions. Interestingly, such VM images boot just fine, since root ignores those permissions; the first sign of trouble was sshd refusing logins with an error message which said absolutely nothing about /etc/ having incorrect permissions or being unable to read files inside it. Immediately prior to running makefs, sort the METALOG file. While we're here, uniquify as well; this does not guarantee that we do not have duplicate paths, but if there are duplicate paths with different settings something else has gone wrong and we don't really have any good way of solving the problem anyway. Reviewed by: ivy Hint from: imp MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D53046 (cherry picked from commit 0cc81b375ea43c7e853b109d00c72c8c3b3df993) --- release/tools/vmimage.subr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 15c4dd53e70b..c3c917dcd642 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -290,6 +290,11 @@ buildfs() { cat ${DESTDIR}/METALOG.pkg >> ${DESTDIR}/METALOG fi + # 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 + mv ${DESTDIR}/METALOG.sorted ${DESTDIR}/METALOG + case "${VMFS}" in ufs) cd ${DESTDIR} && ${MAKEFS} ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \