From nobody Mon Feb 28 22:41:10 2022 X-Original-To: dev-commits-src-main@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 DFDA319E2C3B; Mon, 28 Feb 2022 22:41:11 +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 4K6wMq2bp6z3LrY; Mon, 28 Feb 2022 22:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646088071; 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=3ipWEWlPZwoAjtbWFTiyRmPgm4lHGlO5ivY6d8+wsNE=; b=ZpDv/08aAlPoZODF+7m2cpxyn7WXoRaD87HUqIFXHsTNi3PzdDg3sSruJ+i0XBjPHqbicM vXKhWkvMdauqNM4Geyg8oPisSLkzgz0ixrCE/yJHQUzshvtTZTJ9uNRnQLNrfOnOKLKQE1 pk7PPkl515W9FhQIPIMlg1IymKq//RESIuPp+INTNP0JC0/opekWsXYChRF/OIB186JDVZ 44mqCnaBKrd9djqe8yoG5i1ZzPGKSxRrNguX6iIJn4evOwyN4IlEbM7r3lflwRwUc52aTG P7oqIar5Zq4MP/4Vp/xjq4gN1xtsoO2d2PHmwlbOervL+14BS2kcN1zh92+4oA== 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 E738A23777; Mon, 28 Feb 2022 22:41:10 +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 21SMfA5Z062974; Mon, 28 Feb 2022 22:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21SMfAMF062973; Mon, 28 Feb 2022 22:41:10 GMT (envelope-from git) Date: Mon, 28 Feb 2022 22:41:10 GMT Message-Id: <202202282241.21SMfAMF062973@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: 1a9b1c367fa6 - main - release: Add support for building on non-FreeBSD List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 1a9b1c367fa606c7850cfc876bf73a1e1129279a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646088071; 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=3ipWEWlPZwoAjtbWFTiyRmPgm4lHGlO5ivY6d8+wsNE=; b=HyB1jJUIDMYQDzagMSFsClTPm7Q7xZDNiejJ2f3xzOv5z3WXbmW59caerRty/QkfSOF/be 63uGJDcvPq5k1DALZ/AdHt5r/PsICZ7LQlLSPckjhz4jqfTzi+4r7B3ZyrgGCa+UiHiPRm HdPmbiTtr36cydI715S0l/AVFgtQ2ljIIPxA4x1P4Nhm0hPy4QgpclABod0+nGrvbrYxcE 9RMvM8THr2SjxFsDu16/OxDzSWMaLxazRAsQ3gtKtnEjHHUDOslXSjHktBhOxu2kzW+hCW ha5jrgf7/2XCIh2Vnz8i/je/Jkf/dStnssvoIBqIeMTvwnPiwWTKC99p0BiE1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646088071; a=rsa-sha256; cv=none; b=WbBcn5Y0saY1RREIAGrxGv4RlaMifpgkDVq76S42yj0fSERWy6ejd8Lz3HUbDPmbZX5c6N Ku/n66PaSYrDKEFfo7ejiegFI7MLtvLKDuK6RTKovlUhkYEzBGJNmFDLCq9K/J47mb3rwe xPiOuO2XB77cLO0c74IwxbFZZ1nmcgBo8o38QGq5bmkEKcHr1lQ4hzcwTRHazxbI3vAvZU eyCySnfUuHQrub1AweVCGyGhGF0S2bs/lsYIL/e9rCjrwrgJtR84plBQI0vJIBU8nTcQqh l5pe6Ao/RBypGuKpSD1piSdrQpgOL8O/R+awS3tZfRN3NBLuC2mNKOZhyEXzdQ== 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=1a9b1c367fa606c7850cfc876bf73a1e1129279a commit 1a9b1c367fa606c7850cfc876bf73a1e1129279a Author: Jessica Clarke AuthorDate: 2022-02-28 22:37:37 +0000 Commit: Jessica Clarke CommitDate: 2022-02-28 22:37:37 +0000 release: Add support for building on non-FreeBSD This requires two sets of changes. Firstly, for non-FreeBSD, we do not know where tools are in PATH (and it is likely that some are not in system directories and have been built as bootstrap tools during the build), so we should leave PATH alone and trust the user. Secondly, makefs needs a master.passwd for building images from a METALOG file, so pass the directory in the image tree to makefs's -N option in order to pick up a valid FreeBSD master.passwd; this is unnecessary on FreeBSD (except in the edge case of building an image that refers to users or groups not present in the host's database, which is unlikely but technically possible) but harmless so can be done unconditionally. Reviewed by: brooks, emaste, gjb Differential Revision: https://reviews.freebsd.org/D34001 --- release/amd64/make-memstick.sh | 8 +++++--- release/amd64/mkisoimages.sh | 2 +- release/arm64/make-memstick.sh | 8 +++++--- release/arm64/mkisoimages.sh | 2 +- release/i386/make-memstick.sh | 8 +++++--- release/i386/mkisoimages.sh | 2 +- release/powerpc/mkisoimages.sh | 2 +- release/riscv/make-memstick.sh | 8 +++++--- release/riscv/mkisoimages.sh | 2 +- 9 files changed, 25 insertions(+), 17 deletions(-) diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh index 835dc126d61d..57902e559d10 100755 --- a/release/amd64/make-memstick.sh +++ b/release/amd64/make-memstick.sh @@ -15,8 +15,10 @@ set -e scriptdir=$(dirname $(realpath $0)) . ${scriptdir}/../../tools/boot/install-boot.sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH +if [ "$(uname -s)" = "FreeBSD" ]; then + PATH=/bin:/usr/bin:/sbin:/usr/sbin + export PATH +fi if [ $# -ne 2 ]; then echo "make-memstick.sh /path/to/directory/or/manifest /path/to/image/file" @@ -50,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh index 90e6aed5e7ec..a90578c02ebd 100644 --- a/release/amd64/mkisoimages.sh +++ b/release/amd64/mkisoimages.sh @@ -91,7 +91,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -$MAKEFS -D -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +$MAKEFS -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" rm -f ${espfilename} if [ -n "${METALOG}" ]; then diff --git a/release/arm64/make-memstick.sh b/release/arm64/make-memstick.sh index 0dd6dcfaf4dd..9fcc001fc6fd 100755 --- a/release/arm64/make-memstick.sh +++ b/release/arm64/make-memstick.sh @@ -12,8 +12,10 @@ set -e -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH +if [ "$(uname -s)" = "FreeBSD" ]; then + PATH=/bin:/usr/bin:/sbin:/usr/sbin + export PATH +fi scriptdir=$(dirname $(realpath $0)) . ${scriptdir}/../../tools/boot/install-boot.sh @@ -50,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then diff --git a/release/arm64/mkisoimages.sh b/release/arm64/mkisoimages.sh index b90100286d4a..e7e56eef1cb6 100644 --- a/release/arm64/mkisoimages.sh +++ b/release/arm64/mkisoimages.sh @@ -85,7 +85,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -$MAKEFS -D -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +$MAKEFS -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" rm -f ${espfilename} if [ -n "${METALOG}" ]; then diff --git a/release/i386/make-memstick.sh b/release/i386/make-memstick.sh index 715e4582a4ef..99f419fc0036 100755 --- a/release/i386/make-memstick.sh +++ b/release/i386/make-memstick.sh @@ -12,8 +12,10 @@ set -e -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH +if [ "$(uname -s)" = "FreeBSD" ]; then + PATH=/bin:/usr/bin:/sbin:/usr/sbin + export PATH +fi if [ $# -ne 2 ]; then echo "make-memstick.sh /path/to/directory/or/manifest /path/to/image/file" @@ -47,7 +49,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then diff --git a/release/i386/mkisoimages.sh b/release/i386/mkisoimages.sh index a408fa7cddb2..6ee7f72212c9 100644 --- a/release/i386/mkisoimages.sh +++ b/release/i386/mkisoimages.sh @@ -68,7 +68,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +makefs -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" if [ -n "${METALOG}" ]; then rm ${metalogfilename} diff --git a/release/powerpc/mkisoimages.sh b/release/powerpc/mkisoimages.sh index 362604170fd1..0f13464567f1 100644 --- a/release/powerpc/mkisoimages.sh +++ b/release/powerpc/mkisoimages.sh @@ -107,7 +107,7 @@ echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} fi -makefs -D -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +makefs -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" rm -f /tmp/hfs-boot-block rm -rf "$BASEBITSDIR/ppc" diff --git a/release/riscv/make-memstick.sh b/release/riscv/make-memstick.sh index 0dd6dcfaf4dd..9fcc001fc6fd 100755 --- a/release/riscv/make-memstick.sh +++ b/release/riscv/make-memstick.sh @@ -12,8 +12,10 @@ set -e -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH +if [ "$(uname -s)" = "FreeBSD" ]; then + PATH=/bin:/usr/bin:/sbin:/usr/sbin + export PATH +fi scriptdir=$(dirname $(realpath $0)) . ${scriptdir}/../../tools/boot/install-boot.sh @@ -50,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then diff --git a/release/riscv/mkisoimages.sh b/release/riscv/mkisoimages.sh index b90100286d4a..e7e56eef1cb6 100644 --- a/release/riscv/mkisoimages.sh +++ b/release/riscv/mkisoimages.sh @@ -85,7 +85,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -$MAKEFS -D -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +$MAKEFS -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" rm -f ${espfilename} if [ -n "${METALOG}" ]; then