Revert "bsdinstall: separate out dist selection in prep for pkgbase support"

Firstly, my review comments were not addressed and instead totally
ignored. Secondly, and a more valid justification for the revert, this
completely breaks the installer, since selectdists isn't installed.
Given the blatant lack of testing, back out this commit until it has
actually been tested and review comments taken on board so that the
installer actually works.

This reverts commit 009d3f66cb.
This commit is contained in:
Jessica Clarke 2024-02-03 01:31:11 +00:00
parent 74fe298c82
commit 7143521f4c
3 changed files with 32 additions and 82 deletions

View file

@ -153,10 +153,36 @@ trap true SIGINT # This section is optional
trap error SIGINT # Catch cntrl-C here
if [ -z "$BSDINSTALL_SKIP_HOSTNAME" ]; then bsdinstall hostname || error "Set hostname failed"; fi
if [ -n "$BSDINSTALL_USE_DISTRIBUTIONS" ]; then
exec 5>&1
export DISTRIBUTIONS=$( `dirname $0`/selectdists 2>&1 1>&5 )
exec 5>&-
export DISTRIBUTIONS="${DISTRIBUTIONS:-base.txz kernel.txz}"
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST`
DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')"
if [ -n "$DISTMENU" ]; then
exec 5>&1
EXTRA_DISTS=$( eval bsddialog \
--backtitle \"$OSNAME Installer\" \
--title \"Distribution Select\" --nocancel --separate-output \
--checklist \"Choose optional system components to install:\" \
0 0 0 $DISTMENU \
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
if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then
bsddialog --backtitle "$OSNAME Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0
bsdinstall netconfig || error
NETCONFIG_DONE=yes
fi
rm -f $PATH_FSTAB
@ -321,10 +347,8 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then
[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions"
fi
if [ -n "$BSDINSTALL_USE_DISTRIBUTIONS" ]; then
bsdinstall checksum || error "Distribution checksum failed"
bsdinstall distextract || error "Distribution extract failed"
fi
bsdinstall checksum || error "Distribution checksum failed"
bsdinstall distextract || error "Distribution extract failed"
# Set up boot loader
bsdinstall bootconfig || error "Failed to configure bootloader"

View file

@ -1,73 +0,0 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
# Copyright (c) 2013-2018 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
############################################################ INCLUDES
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
############################################################ CONFIGURATION
#
# Default distributions
#
DISTRIBUTIONS="${DISTRIBUTIONS:-base.txz kernel.txz}"
############################################################ MAIN
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST`
DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')"
if [ -n "$DISTMENU" ]; then
EXTRA_DISTS=$( eval bsddialog \
--backtitle \"$OSNAME Installer\" \
--title \"Distribution Select\" --nocancel --separate-output \
--checklist \"Choose optional system components to install:\" \
0 0 0 $DISTMENU \
2>&1 >&3 )
for dist in $EXTRA_DISTS; do
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
if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then
bsddialog --backtitle "$OSNAME Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0
bsdinstall netconfig || error
NETCONFIG_DONE=yes
fi
echo $DISTRIBUTIONS >&2

View file

@ -6,7 +6,6 @@
: ${BSDDIALOG_EXTRA=3}
: ${BSDDIALOG_ESC=5}
: ${BSDDIALOG_ERROR=255}
export BSDINSTALL_USE_DISTRIBUTIONS=y
kbdcontrol -d >/dev/null 2>&1
if [ $? -eq 0 ]; then