bsdinstall: add pkgbase prompt to auto script
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49824
This commit is contained in:
@@ -153,36 +153,50 @@ 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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
if [ "$PKGBASE" == yes ]; then
|
||||
bsddialog --backtitle "$OSNAME Installer" --title "Network Installation" \
|
||||
--msgbox "Installation of base system packages currently requires internet access. The next few screens will allow you to configure networking." 0 0
|
||||
bsdinstall netconfig || error
|
||||
NETCONFIG_DONE=yes
|
||||
else
|
||||
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
|
||||
fi
|
||||
|
||||
rm -f $PATH_FSTAB
|
||||
@@ -339,16 +353,20 @@ esac
|
||||
|
||||
[ -f /usr/libexec/bsdinstall/local.pre-fetch ] && f_dprintf "Running local.pre-fetch" && sh /usr/libexec/bsdinstall/local.pre-fetch "$BSDINSTALL_CHROOT"
|
||||
|
||||
if [ -n "$FETCH_DISTRIBUTIONS" ]; then
|
||||
exec 5>&1
|
||||
export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&5)
|
||||
FETCH_RESULT=$?
|
||||
exec 5>&-
|
||||
if [ "$PKGBASE" == yes ]; then
|
||||
bsdinstall pkgbase || error "Installation of base system packages failed"
|
||||
else
|
||||
if [ -n "$FETCH_DISTRIBUTIONS" ]; then
|
||||
exec 5>&1
|
||||
export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&5)
|
||||
FETCH_RESULT=$?
|
||||
exec 5>&-
|
||||
|
||||
[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions"
|
||||
[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions"
|
||||
fi
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user