From nobody Thu Jul 14 00:33:08 2022 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 E11161D210B1; Thu, 14 Jul 2022 00:33:08 +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 4LjwSh5kZRz3jNf; Thu, 14 Jul 2022 00:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657758788; 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=AXYeNBVcCY2JBBe8QkvrUVISBLY3jQ1711sx/X8/w6c=; b=VEZcpi/sJ1EhLEZ2KLs5Xc2v7bgkpK13cVVYcc1lBPAXkIj+aTK2cmaYi822l3kXNwZj7i lJ2miRxbpjZnN0IoOtupccleUzeefselrGA5oc+ToE2Qnnc6U5QETUKqj8da3kVD9N2lgx lbOKqKmIT0X7utFUlVOTAIYSL/0PbQMrrf0+IqZmUGB8yGHeN7Jrn0BSUE0CkT951/asL5 GOALIOMxyxNS9f5YvQ7+AS2UFnB2uG+PVz5gtd70jKDkZdtIwkPNm6L64Nh0XRKq5k+kqK uNWt/G2eLy8g/TNeeMe0dR6BfmSVvU/tUNizG0325/EwLm7JpteyVuudl1rzrA== 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 4LjwSh4l7YzkQS; Thu, 14 Jul 2022 00:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26E0X8U2089218; Thu, 14 Jul 2022 00:33:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26E0X8oO089217; Thu, 14 Jul 2022 00:33:08 GMT (envelope-from git) Date: Thu, 14 Jul 2022 00:33:08 GMT Message-Id: <202207140033.26E0X8oO089217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 7e45839aca71 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 7e45839aca7157a73b0309e8cf4cb811d2cb5512 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657758788; 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=AXYeNBVcCY2JBBe8QkvrUVISBLY3jQ1711sx/X8/w6c=; b=GQ/GDRq1YMrem5+brGawFdceLg7qmHJXPyPsZnmKuGEdPKCBobOf25Zx7dlmVuxh1oLU+6 neI7PMc1WI3vEOdhw4nuRJaUxx7ItT83C1qF2awOmyDSJMksMakcnG3c12pkeLGdRNRMue trvGdBo+DG6EsLnDtcRurECJGSsZfo4sTKTu6XYzXphL/Rdh71af7mnAsBTT9xSlI8Vjsa cT5mj/ty+UrJu84IrcEEgcdtbrxWxOVtSa9R2nfjLINkG1DJSW3V9VROhw6dCRGxZvTQ+y atRxUjhIC+YjKt14IXWlN2CyD4n4wHptx/X7NEIphMneR7tR+HPNVi2EjmAqSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657758788; a=rsa-sha256; cv=none; b=Jiqu25iwwCCly6tjKwXcuY7pWRDitqY62QheM0URIJsytcJIgjLQf6RC1dlzZZFzBGmRH2 6+Z/CQUa8W7R6fEsdX39m0d7ZwFBtYCl5mPFkU2rFjA+Dfe5jeqz2IYIfBTFXAP0HHVn4d 5SSISnbUiBiRJPwwqWrIq4600DLDZyCx/2D35//XSGrczDNXI/gx5r/yVctJRKlhnrB2qi mTcdOmNmkV8x0ZRY3Er6aECP8yHwHTRNTWLvYZE+L1YRHxB8KLb3HZ7PxS7aQvCtTmUXsx f8ums57ag1yrMyfybI0hyCbqxe3z48+6fAHjw+5ZVB/kaBQQYLM3bVlZGmQzTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7e45839aca7157a73b0309e8cf4cb811d2cb5512 commit 7e45839aca7157a73b0309e8cf4cb811d2cb5512 Author: Jessica Clarke AuthorDate: 2022-07-14 00:25:50 +0000 Commit: Jessica Clarke CommitDate: 2022-07-14 00:25:50 +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 --- Makefile.inc1 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c384267b0ada..1b3471bb1433 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -948,10 +948,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 @@ -1443,6 +1445,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 @@ -1470,14 +1480,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}