Index: usr.sbin/bsdinstall/scripts/checksum =================================================================== --- usr.sbin/bsdinstall/scripts/checksum +++ usr.sbin/bsdinstall/scripts/checksum @@ -37,10 +37,13 @@ for i in $DISTRIBUTIONS; do items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`" done - dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \ - --mixedgauge "Verifying checksums of selected distributions." \ - 0 0 $percentage $items - + if f_interactive; then + dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \ + --mixedgauge "Verifying checksums of selected distributions." \ + 0 0 $percentage $items + else + f_dprintf "Checksum verification: $dist" + fi CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist` awk -v checksum=$CK -v dist=$dist -v found=0 '{ if (dist == $1) { @@ -62,8 +65,12 @@ percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) else eval "status_$distname=1" - dialog --backtitle "FreeBSD Installer" --title "Error" \ - --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + if f_iteractive; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + else + f_dprintf "Checksum verification for $dist failed" + fi exit 1 fi done Index: usr.sbin/bsdinstall/scripts/script =================================================================== --- usr.sbin/bsdinstall/scripts/script +++ usr.sbin/bsdinstall/scripts/script @@ -53,16 +53,22 @@ error() { - [ -f "$PATH_FSTAB" ] && bsdinstall umount - local file f_getvar "$VAR_DEBUG_FILE#+" file if [ "$file" ]; then - f_dialog_title "$msg_installation_error" - f_dialog_textbox "$file" + f_dprintf "$msg_installation_error" + f_dprintf "$file" # No need to restore title, pining for the fjords fi + [ ! -f "$PATH_FSTAB" ] && exit 1 + if [ "$ZFSBOOT_DISKS" ]; then + zfs umount -a + umount $BSDINSTALL_CHROOT + else + bsdinstall umount + fi + exit 1 } @@ -99,12 +105,25 @@ bsdinstall zfsboot else bsdinstall scriptedpart "$PARTITIONS" + bsdinstall mount fi -bsdinstall mount + +# Fetch distributions +# NB: distfetch is not suitable because it requires a tty. +mkdir -p $BSDINSTALL_DISTDIR +for set in $DISTRIBUTIONS MANIFEST; do + if [ ! -e "$BSDINSTALL_DISTDIR/$set" ]; then + f_dprintf "Fetching $BSDINSTALL_DISTSITE/$set" + fetch "$BSDINSTALL_DISTSITE/$set" -o "$BSDINSTALL_DISTDIR/$set" + fi +done # Unpack distributions bsdinstall checksum -bsdinstall distextract +for set in $DISTRIBUTIONS; do + f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set" + tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT +done # Finalize install bsdinstall config @@ -125,7 +144,12 @@ fi bsdinstall entropy -bsdinstall umount +if [ "$ZFSBOOT_DISKS" ]; then + zfs umount -a + umount $BSDINSTALL_CHROOT +else + bsdinstall umount +fi f_dprintf "Installation Completed at %s" "$( date )"