From nobody Tue Aug 1 21:06:42 2023 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 4RFnjR2wBwz4prWV; Tue, 1 Aug 2023 21:06:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RFnjH5d4Mz3LnH; Tue, 1 Aug 2023 21:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690924003; 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=XbY+HtYWSvkmNc56VgW154RZZzp0WeCI6rj0ll1nPC8=; b=LyGrl/hRhnY47R8bQMYEN29QQ5sex2qHuqhHQsCugWzBczjAq3K+DD/t4NaLp/w9mXJ8kS 3EEMuNeg/hk3GeawqyU4NTO/xTQ0y3YUclSYHZJJNYPtH97dFawYmdgmxomARkDYlKIAjX KVfj6NNONtKARoIqTqZxTd5tUjcT7CLQ5JL6fekfwkxDi4tCx6QTfMnbV2hAtkqmV+mVjr O/T02kLP+Lf+9bcTeTL5gh5gVLTiw1Zv9pvy/X36mBXYaTd9dHFhetqmdvNvwUA/suEzDu O2e7h2hrg2jRPZKU5kPP6qXXnkNU9AXmwg1FWMt0u4ClFLiSOHO7NHF+Eil1ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690924003; a=rsa-sha256; cv=none; b=ZCtwEJthqNfBdt6kwZ3mux+8vPhGi2/uzeUbHCJwuZM/UIIXDX6S1tIwiUUZqMf9Zf9siB 9x7PDiXr9VuRgb5v1t5ceqBPH3W2G2BDlICPQ7jEQq+sJTlxnJnIIAAjM8WLqZe5s2kof8 cGnHtJA0aY2QmgnIsJJA3al9jq5aAQpGfv+L9VGshwsT2FzKRdHeC1FSX/M48jGVYCgt0Q M994l2duxPtQYH0y9XZ8s30xJmARiNlfVAQqBJmUIwbVJS6qw07OJskhyQOdLyRJ8/bgMu x1yY5zqzDX30XgXMI/k7PJXtARLpIS0hKcRvvcurtGeiVmZtxmVfzsfI3gSq/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690924003; 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=XbY+HtYWSvkmNc56VgW154RZZzp0WeCI6rj0ll1nPC8=; b=jT6Xv5xdC9hUpZfn+xRPkdsoe4DtDV6s4ZlMFzWxE+IbCqkD82vA/6pf4uka5T7Aekg8RB kvnm2Am1EYga0XvnZu+Z4AXKwAVClu4nq4nQft19a0DTr2XGsQiqYTHGkun1nLdENpL32u pUyqQp0l8wFNVSULFzrp15LyI+2AIoIH87tPWQBNPRFL8KT8um95p5bM8Hyx67DLGpkaaP dqH1unfynEuOaakpsGOqs37/UR/tEaquInbcsnQ6XzK6xbs7BiAuIQvPG/tFltKBQmFHPC pXt6Gy1Rc5+kht7EEpRX/CDYddwNgI7d56Av7crvGV9JFU1LrEkve7GmFG5lTg== 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 4RFnjG23jLzsRQ; Tue, 1 Aug 2023 21:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 371L6g1o013741; Tue, 1 Aug 2023 21:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 371L6g2X013740; Tue, 1 Aug 2023 21:06:42 GMT (envelope-from git) Date: Tue, 1 Aug 2023 21:06:42 GMT Message-Id: <202308012106.371L6g2X013740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f20cf1e5dcbb - stable/13 - Makefile.inc1: Fix -DNO_ROOT distributeworld certctl usage 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f20cf1e5dcbbc458846376451baae282f29b0c41 Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f20cf1e5dcbbc458846376451baae282f29b0c41 commit f20cf1e5dcbbc458846376451baae282f29b0c41 Author: Jessica Clarke AuthorDate: 2022-07-14 00:25:50 +0000 Commit: Jessica Clarke CommitDate: 2023-08-01 20:42:52 +0000 Makefile.inc1: Fix -DNO_ROOT distributeworld certctl usage Currently for distributeworld we pass DESTDIR to certctl.sh as an environment variable, which sets the default value in the script. However, for -DNO_ROOT builds, CERTCTLFLAGS has METALOG_INSTALLFLAGS which includes -D ${DESTDIR}, overriding the custom DESTDIR pointing at the base dist directory. Moreover, in order to ensure that the METALOG includes the base/ prefix for all the files, we need to have certctl call install with -D set to DESTDIR/DISTDIR without the /base suffix but also ensure the files get installed to DESTDIR/DISTDIR/base. Fix these by passing the custom DESTDIR to certctl via -D rather than in the environment and to pass the /base suffix in the distributeworld case via the newly-added -d option. We also need to run certctl rehash before we generate the .meta files from the METALOG, not after, otherwise they won't include the METALOG additions, so move the certctl rehash call. Finally, add a missing semicolon that results in no message being printed in the missing openssl case. By not including the semicolon, else echo "..." is treated as extra arguments to certctl, which is lax in its argument parsing and ignores additional arguments, and the semicolon and fi after the intended echo terminate the if statement as normal so there's no syntax error at the shell level. This is harmless as we weren't trying to do anything other than echo anyway, all that happens is the echo doesn't actually get run. Reported by: markj (missing semicolon) Reviewed by: brooks, kevans Obtained from: CheriBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35809 (cherry picked from commit 7e45839aca7157a73b0309e8cf4cb811d2cb5512) --- Makefile.inc1 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1328b7177a71..3f858b182238 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -956,10 +956,12 @@ IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif .if make(distributeworld) -CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR}/base +CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR} +CERTCTLFLAGS+= -d /base .else CERTCTLDESTDIR= ${DESTDIR} .endif +CERTCTLFLAGS+= -D "${CERTCTLDESTDIR}" DESTDIR_MTREEFLAGS= -deU # When creating worldtmp we don't need to set the directories as owned by root @@ -1450,6 +1452,14 @@ distributeworld installworld stageworld: _installcheck_world .PHONY .endif # make(distributeworld) ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ ${IMAKEENV} rm -rf ${INSTALLTMP} +.if !make(packageworld) && ${MK_CAROOT} != "no" + @if which openssl>/dev/null; then \ + PATH=${TMPPATH}:${PATH} \ + sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash; \ + else \ + echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \ + fi +.endif .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete @@ -1477,14 +1487,6 @@ distributeworld installworld stageworld: _installcheck_world .PHONY .endfor .endif .endif # make(distributeworld) -.if !make(packageworld) && ${MK_CAROOT} != "no" - @if which openssl>/dev/null; then \ - DESTDIR=${CERTCTLDESTDIR} PATH=${TMPPATH}:${PATH} \ - sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash \ - else \ - echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \ - fi -.endif packageworld: .PHONY .for dist in base ${EXTRA_DISTRIBUTIONS}