From nobody Mon Feb 28 22:41:06 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 8A14019E2D0C; Mon, 28 Feb 2022 22:41:06 +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 4K6wMk3XS3z3LlX; Mon, 28 Feb 2022 22:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646088066; 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=hdqzmO05p68rhMBlewphSIUJp8ar6Wil9Yxu28+DBQU=; b=gBXh8n6SWDi83YNMV810BxYEHJS96r2nK58e6WuCqlynAJ0RhjQGZJV2Smv5PRVAJNTyi5 KHFKxdIIMwav8tnt76o11tLJjtKIy/o7l0w1HQn7DEOBrBwBCbKtyae7ScOLnqJrXzZYDN HugG5FJoaiHR2KM5kT24dWq08bETdLjhPcm/7lZynd0RMGtHqFL4R+XhO23i5+JPT8CJ/U 1ucLnUdiZRagOH2SZW9ux4TrJVgPML4Lwww1rkG7ArdZLRRJTrtj+yrh2XwSYTZ/bkvMAI GC3z3GGPHHzHOiw2Tb53OZWVBFJPtk0GuBlnJHwhOrO0VS5knn81RxgPPXyaJg== 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 58FB123E17; Mon, 28 Feb 2022 22:41:06 +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 21SMf6Qn062874; Mon, 28 Feb 2022 22:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21SMf6f5062873; Mon, 28 Feb 2022 22:41:06 GMT (envelope-from git) Date: Mon, 28 Feb 2022 22:41:06 GMT Message-Id: <202202282241.21SMf6f5062873@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: b58ea3e1f777 - main - Fix hand-rolled METALOG entries for installconfig during distributeworld 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: b58ea3e1f7779aac4eebcec5dffc9ebef203e583 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646088066; 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=hdqzmO05p68rhMBlewphSIUJp8ar6Wil9Yxu28+DBQU=; b=kWj8SDYe7mEbyewInVlRk8OwJGnhvCIJ2X/oehRmbZDtPol2ta5/5pYHP55GKTpkYz5P01 WKuOsIZrVNySE1PmfR1LPgSKEwH2ZFkjOAqfrgdwAngwi0ki3VdZXapcbcmvJbxQ83BJLf L37ueWC82vXxfyhnfq1o1ZoUu3awd+j+DSshmwBWW/IFaDuf85VEEDpPMI3oqv8wKhzjst hB2NUaU/hXkpc/IN0B/S7HrYLcvH+lV0ZXfJZITYcQnFlbKvXjC9FPH0vfLbsojPXtM4XT bJPhNmg/GblManlDC6v5AG4vFFmsb4IffeuIr5UDzKzSsOLwPwzaV8uFodQOzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646088066; a=rsa-sha256; cv=none; b=WuvOt0WnnYuVZoVZaf4mJfA0JVVEMwD1JvzOSz0GuLUhlrthGbTPSR4IZhsj6+y+3ytuRD ivktRRtvq+ObBGmMbrhwVCSZNg+3/Gn8Yld2dVJSL9/LB2ywXucTbd2mR6VWBJ1pb2CyMw xdr+MEVo2cyc2M/WfC4OrRh0J/UHj4qaWHc89wMzVIE26248OsazHP5DmuVWotK+wDqfpy Rt8EwZ209yFEKtt75/kuMe4ptwcBWgQFQg+haIxExDTti1WqbCa+8opMu65/PtGSzG24Y2 EVC9sfRsr7xg3f8qZS47ZmIen0L76UisaIh6N2Zv1XsS4kUBD1eoGM137FzQVA== 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=b58ea3e1f7779aac4eebcec5dffc9ebef203e583 commit b58ea3e1f7779aac4eebcec5dffc9ebef203e583 Author: Jessica Clarke AuthorDate: 2022-02-28 22:36:39 +0000 Commit: Jessica Clarke CommitDate: 2022-02-28 22:36:39 +0000 Fix hand-rolled METALOG entries for installconfig during distributeworld During distributeworld we call distribute on subdirectories, which in turn calls installconfig. However, this recursive installconfig call appends the distribution name (in these cases, "base") to DESTDIR. For install(1) this works fine as its -D argument comes from the top-level Makefile.inc1, which passes the original DESTDIR, thereby resulting in the METALOG entry having the distribution name as a prefix representing its true installed path relative to the root, but for the hand-rolled entries they do not use install(1) and thus do not have access to what the original DESTDIR was, resulting in the METALOG missing this prefix. Thus, pass down the name of the distribution via a new variable DISTBASE (chosen as Makefile.inc1 already uses that to convey this exact same information to etc's distrib-dirs during distributeworld) and prepend this to the handful of manually-generated METALOG entries. For the installworld case this variable will be empty and so this behaves as before. Note that we need to be careful to avoid double slashes in the METALOG; distributeworld uses find | awk to split the single METALOG up into multiple dist.meta files, and this relies on the paths in the METALOG having the exact prefix ./dist (or ./dist/usr/lib/debug). Reviewed by: brooks, emaste Differential Revision: https://reviews.freebsd.org/D33997 --- lib/libc/gen/Makefile.inc | 6 +++--- share/mk/bsd.subdir.mk | 2 +- usr.bin/login/Makefile | 2 +- usr.sbin/services_mkdb/Makefile | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index fd8a0feeb748..395edefc0503 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -573,8 +573,8 @@ install-passwd: .PHONY ${PWD_MKDB_CMD} -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) && defined(METALOG) ( \ - echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ - echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ - echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ + echo ".${DISTBASE}/etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ + echo ".${DISTBASE}/etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ + echo ".${DISTBASE}/etc/passwd type=file mode=0644 uname=root gname=wheel"; \ ) | cat -l >> ${METALOG} .endif diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 91c114f8d361..fb686a101322 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -94,7 +94,7 @@ DISTRIBUTION?= base distribute: .MAKE .for dist in ${DISTRIBUTION} ${_+_}cd ${.CURDIR}; \ - ${MAKE} install installconfig -DNO_SUBDIR DESTDIR=${DISTDIR}/${dist} SHARED=copies + ${MAKE} install installconfig -DNO_SUBDIR DISTBASE=/${dist} DESTDIR=${DISTDIR}/${dist} SHARED=copies .endfor .endif # Convenience targets to run 'build${target}' and 'install${target}' when diff --git a/usr.bin/login/Makefile b/usr.bin/login/Makefile index c876434dcc2e..f8e62d4f934f 100644 --- a/usr.bin/login/Makefile +++ b/usr.bin/login/Makefile @@ -30,7 +30,7 @@ PRECIOUSPROG= afterinstallconfig: ${CAP_MKDB_CMD} ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf .if defined(NO_ROOT) && defined(METALOG) - echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel" | \ + echo ".${DISTBASE}/etc/login.conf.db type=file mode=0644 uname=root gname=wheel" | \ cat -l >> ${METALOG} .endif diff --git a/usr.sbin/services_mkdb/Makefile b/usr.sbin/services_mkdb/Makefile index 9d728b6da824..c1edc37452ab 100644 --- a/usr.sbin/services_mkdb/Makefile +++ b/usr.sbin/services_mkdb/Makefile @@ -17,7 +17,7 @@ afterinstallconfig: ${SERVICES_MKDB_CMD} ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ ${DESTDIR}/etc/services .if defined(NO_ROOT) && defined(METALOG) - echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel" | \ + echo ".${DISTBASE}/var/db/services.db type=file mode=0644 uname=root gname=wheel" | \ cat -l >> ${METALOG} .endif .endif