It is possible to restart the installation process upon errors, when installing normally through the `auto` script, or when installing 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 re-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.
Other environment variables reset by this patch include the list of system components to install, the ZFS partitioning scheme, and some platform-specific workarounds.
This is believed to solve PR #266987.
This is a broader and cleaner fix than D42183, which only solved this issue when choosing mirrors while setting up jails.
The patch is also available on GitHub at https://github.com/khorben/freebsd-src/tree/khorben/bsdinstall-restart-reset-env.