diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -90,6 +90,7 @@ --yes-label "$msg_restart" \ --yesno "$prompt" $height $width then + environment_restore exec $0 # NOTREACHED fi @@ -138,10 +139,26 @@ --yesno "$prompt" $height $width } +environment_restore() +{ + BSDINSTALL_DISTSITE="$ORIG_BSDINSTALL_DISTSITE" + DISTRIBUTIONS="$ORIG_DISTRIBUTIONS" + unset WORKAROUND_GPTACTIVE WORKAROUND_LENOVO + unset ZFSBOOT_PARTITION_SCHEME +} + +environment_save() +{ + ORIG_BSDINSTALL_DISTSITE="$BSDINSTALL_DISTSITE" + ORIG_DISTRIBUTIONS="$DISTRIBUTIONS" +} + ############################################################ MAIN f_dprintf "Began Installation at %s" "$( date )" +environment_save + rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -48,16 +48,30 @@ if [ $? -ne $BSDDIALOG_OK ]; then exit else - [ -z "$MIRROR_BUTTON" ] || unset BSDINSTALL_DISTSITE + environment_restore exec $0 $BSDINSTALL_CHROOT fi } +environment_restore() +{ + BSDINSTALL_DISTSITE="$ORIG_BSDINSTALL_DISTSITE" + DISTRIBUTIONS="$ORIG_DISTRIBUTIONS" +} + +environment_save() +{ + ORIG_BSDINSTALL_DISTSITE="$BSDINSTALL_DISTSITE" + ORIG_DISTRIBUTIONS="$DISTRIBUTIONS" +} + if [ -z "$1" ]; then error "Directory can not be empty\n\nUsage:\nbsdinstall jail directory" fi export BSDINSTALL_CHROOT=$1 +environment_save + rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC mkdir -p $1 || error "mkdir failed for $1"