bsdinstall: reset the mirror when restarting

It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when setting up a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts are kept in the environment when
restarting the process; this makes it impossible to run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembers the choice made, and will
never prompt for a different one. Rebooting is then the only easy way
out of this situation.

This change only affects the `jail` script for now, as otherwise there
is no way to tell if the value had been specifically set by the user
before starting bsdinstall.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42183
This commit is contained in:
Pierre Pronchery 2023-10-12 22:34:06 +02:00 committed by Ed Maste
parent ac78e3e9c5
commit 01ab86f7e6

View file

@ -49,6 +49,7 @@ error() {
if [ $? -ne $BSDDIALOG_OK ]; then
exit
else
[ -z "$MIRROR_BUTTON" ] || unset BSDINSTALL_DISTSITE
exec $0 $BSDINSTALL_CHROOT
fi
}