From nobody Tue Apr 29 00:35:12 2025 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 4ZmhDK1h8Rz5v7BY; Tue, 29 Apr 2025 00:35:13 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZmhDK1183z3dKr; Tue, 29 Apr 2025 00:35:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745886913; 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=ccFQ2nREGCZGTgJA3QCCZK2LAFKJGkJM3maB0jeEno0=; b=D1wRkKe0cXq5n4zFt3I4Pd0Gtu9YvWccjnubbtsQMouV4Ut5uwEEzOkgE3DXutslarqaMn YgxKDCcUHr0K7opwoFJf/xz8sLtDOsh3dngVAIkC4esApFnsnTcMML06Ibd3AxgL8zQoCN 1uATOpXbIt8tWZqHqMJlC7ajb5MX50jg2n6mmBtefq6qiQUIxxD3ei2+SCWho6m2qcqaZR Vr52ueZ4j0gg0qEU4hVPtoJUohXMlaQbGEUCBELARB0y2BS8pnrQKpSiUR95BAmeV65t/G ctkCUP6/bpJud5+1M0xjsUF6/dps90K070N+gE+93U+nRKDxoNcBKNkxnYv2bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745886913; a=rsa-sha256; cv=none; b=WxQZISIBErehUzihEQ1e1Scaysn71GlEJlHIKo1MDeALja8P0HlHG4RmGP1FE2vpJkSgm3 KBnuLJyzcJr+rplgmfTccnDIht4otdgt9VnbTOqLb58gSmqNFX5zm+f4cnDVfieSxnpAj+ EQ0cmvZNXAsEMkuhjtmwSAXWfc00y1uoqcNp3TmBVtNrsUsKMCtbIWlbzlQ7LJUwq0M3ql EBAyPFWaB1rL20NTMGC/+bi1YpvNYM1UPKar4L+GsrCbRsQSPToeG6qo+IcGkt+EMPAob/ q7MXJbigTaWcstIzFg+GBw0GGtA1iz42tahN9QAv2YegGIYBlZVsnS4EKKVPMw== 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=1745886913; 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=ccFQ2nREGCZGTgJA3QCCZK2LAFKJGkJM3maB0jeEno0=; b=EKw0cC8zz7JXiqrQIeLC3ivqD/G0Ls0llU6Bo+9/q+gpeoI9UofyMB4unGVQk1bJLL1QF+ LXGPhii6T+gvonK9lkGihJ0hNT2fGPsOllvMOcnVD/Hyfo7D7zbIiwgaiHsVj1dDwmhw7d BZ0syT648ltuPr/srWe0wFu/av61mIdQMm6VKkF2dDwbnbObhiG+5a4DvQONHgyM4z07tx owtmZC5Otp1ZDMLJOdj+bvgRo9ooIIdJ4QusKDWf3gS7ukR0HB6wZ7MgDrzNQyA8yTlH76 bgaM6eIk8SCkC5xKlDQk+O4nqUzpqEoj8WR90biR4sANkBq/zZp18BtPk973oA== 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 4ZmhDK080jzxWs; Tue, 29 Apr 2025 00:35:13 +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 53T0ZCTu094336; Tue, 29 Apr 2025 00:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53T0ZCHe094333; Tue, 29 Apr 2025 00:35:12 GMT (envelope-from git) Date: Tue, 29 Apr 2025 00:35:12 GMT Message-Id: <202504290035.53T0ZCHe094333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 4daf244aedfc - main - bsdinstall: add pkgbase prompt to jail script 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4daf244aedfccbae54bd0a1949940ef974605ade Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4daf244aedfccbae54bd0a1949940ef974605ade commit 4daf244aedfccbae54bd0a1949940ef974605ade Author: Isaac Freund AuthorDate: 2025-04-14 10:03:14 +0000 Commit: Ed Maste CommitDate: 2025-04-29 00:34:18 +0000 bsdinstall: add pkgbase prompt to jail script Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49823 --- usr.sbin/bsdinstall/scripts/jail | 118 ++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 50 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index 9acea20a34d8..641c9f8a22bc 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -53,6 +53,64 @@ error() { fi } +distbase() { + test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR + + if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST -a -z "$BSDINSTALL_DISTSITE" ]; then + exec 5>&1 + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&5) + MIRROR_BUTTON=$? + exec 5>&- + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" + export BSDINSTALL_DISTSITE + fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error "Could not download $BSDINSTALL_DISTSITE/MANIFEST" + fi + + : ${DISTRIBUTIONS="base.txz"}; export DISTRIBUTIONS + if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then + DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base` + + if [ ! "$nonInteractive" == "YES" ] + then + exec 5>&1 + EXTRA_DISTS=$(echo $DISTMENU | xargs -o bsddialog \ + --backtitle "$OSNAME Installer" \ + --title "Distribution Select" --no-cancel \ + --separate-output \ + --checklist "Choose optional system components to install:" \ + 0 0 0 \ + 2>&1 1>&5) + for dist in $EXTRA_DISTS; do + export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" + done + fi + fi + + FETCH_DISTRIBUTIONS="" + for dist in $DISTRIBUTIONS; do + if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then + FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" + fi + done + FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space + + if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then + exec 5>&1 + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&5) + MIRROR_BUTTON=$? + exec 5>&- + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" + export BSDINSTALL_DISTSITE + fi + + if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then + bsdinstall distfetch || error "Failed to fetch distribution" + fi + + bsdinstall checksum || error "Distribution checksum failed" + bsdinstall distextract || error "Distribution extract failed" +} + if [ -z "$1" ]; then error "Directory can not be empty\n\nUsage:\nbsdinstall jail directory" fi @@ -73,61 +131,21 @@ if [ -n "$SCRIPT" ]; then . $TMPDIR/bsdinstall-installscript-preamble fi -test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR - -if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST -a -z "$BSDINSTALL_DISTSITE" ]; then - exec 5>&1 - BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&5) - MIRROR_BUTTON=$? - exec 5>&- - test $MIRROR_BUTTON -eq 0 || error "No mirror selected" - export BSDINSTALL_DISTSITE - fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error "Could not download $BSDINSTALL_DISTSITE/MANIFEST" -fi - -: ${DISTRIBUTIONS="base.txz"}; export DISTRIBUTIONS -if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then - DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base` - - if [ ! "$nonInteractive" == "YES" ] - then - exec 5>&1 - EXTRA_DISTS=$(echo $DISTMENU | xargs -o bsddialog \ - --backtitle "$OSNAME Installer" \ - --title "Distribution Select" --no-cancel --separate-output \ - --checklist "Choose optional system components to install:" \ - 0 0 0 \ - 2>&1 1>&5) - for dist in $EXTRA_DISTS; do - export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" - done - fi -fi - -FETCH_DISTRIBUTIONS="" -for dist in $DISTRIBUTIONS; do - if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then - FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" +if [ ! "$nonInteractive" == "YES" ]; then + bsddialog --backtitle "$OSNAME Installer" --title "Select Installation Type" \ + --yes-label "Traditional" --no-label "Packages (Experimental)" --yesno \ + "Would you like to install the base system using traditional distribution sets or packages (experimental)?" 0 0 + if [ $? -eq 1 ]; then + PKGBASE=yes fi -done -FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space - -if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then - exec 5>&1 - BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&5) - MIRROR_BUTTON=$? - exec 5>&- - test $MIRROR_BUTTON -eq 0 || error "No mirror selected" - export BSDINSTALL_DISTSITE fi -if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then - bsdinstall distfetch || error "Failed to fetch distribution" +if [ "$PKGBASE" == yes ]; then + bsdinstall pkgbase --no-kernel || error "Installation of base system packages failed" +else + distbase fi -bsdinstall checksum || error "Distribution checksum failed" -bsdinstall distextract || error "Distribution extract failed" - if [ ! "$nonInteractive" == "YES" ] then bsdinstall rootpass || error "Could not set root password"