When the preamble contain the variable ZFSBOOT_DATASETS install process fail. Because $TMP_FSTAB of bsdinstall/umount is empty. ``` --- FreeBSD-10.3-RELEASE-amd64-disc1/usr/libexec/bsdinstall/umount.orig 2016-03-25 11:14:43.000000000 +0900 +++ FreeBSD-10.3-RELEASE-amd64-disc1/usr/libexec/bsdinstall/umount 2016-07-06 12:39:21.810951339 +0900 @@ -39,4 +39,4 @@ }' > $TMP_FSTAB umount $BSDINSTALL_CHROOT/dev 2>/dev/null -umount -F $TMP_FSTAB -a 2>/dev/null +test -s $TMP_FSTAB && umount -F $TMP_FSTAB -a 2>/dev/null ``` FreeBSD-10.3-RELEASE-amd64-disc1/usr/libexec/bsdinstall/script ``` ############################################################ FUNCTIONS 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" # No need to restore title, pining for the fjords fi exit 1 } ############################################################ MAIN set -e trap error EXIT [...] bsdinstall entropy bsdinstall umount <= fail!! f_dprintf "Installation Completed at %s" "$( date )" ```
Created attachment 172171 [details] dmesg -a
Created attachment 172172 [details] new patch the last patch does not fix problem. the correct one is here.
I am very unclear on what caused the error. Setting ZFSBOOT_DATASETS to 'da0' is invalid, it is supposed to be a list of datasets to create, and search should start with a /, as it is prefixed with the pool name. You also need to create some dataset with a mountpoint of /. I also do not see how setting this variable affects TMP_FSTAB, with ZFS, it is always blank except for swap. Can you provide a fuller reproduction case?
Created attachment 172829 [details] umount
Sorry ZFSBOOT_DATASETS is typo... Here is /etc/installerconfig: DISTRIBUTIONS="kernel.txz base.txz src.txz" export ZFSBOOT_DISKS=nvd0 export ZFSBOOT_DISKS=da0 export ZFSBOOT_SWAP_SIZE=64g export ZFSBOOT_DATASETS=" /ROOT mountpoint=none /ROOT/default mountpoint=/ /tmp mountpoint=/tmp,exec=on,setuid=off /usr mountpoint=/usr,canmount=off /home mountpoint=/home /home/admin /usr/ports setuid=off /usr/src /usr/local /var mountpoint=/var,canmount=off /var/audit exec=off,setuid=off /var/crash exec=off,setuid=off /var/log exec=off,setuid=off /var/db canmount=off /var/db/pkg /var/mail atime=on /var/tmp setuid=off " export nonInteractive=1 I uploaded the detail error message screen shot file.
11.0-RC1 has same problem.
I think the issue is that on a clean install with root on ZFS, the only entry in the $PATH_FSTAB file is a swap partition, which doesn't match the RegEx on line 32 and leaves $TMP_FSTAB empty. I created a workaround/potential patch to ensure that $TMP_FSTAB was non-zero length before trying to feed it into umount and was able to install successfully afterwards. --- /usr/libexec/bsdinstall/umount 2016-08-04 21:28:50.000000000 -0500 +++ ./umount 2016-10-05 23:33:25.750217000 -0500 @@ -39,4 +39,6 @@ }' > $TMP_FSTAB umount $BSDINSTALL_CHROOT/dev 2>/dev/null +if [ -s $TMP_FSTAB ]; then umount -F $TMP_FSTAB -a 2>/dev/null +fi
I just spent several hours coming to the same conclusion as the previous comment, and then found this bug. Any change of it getting some attention? It is still a problem in 11-STABLE, and I cannot see how it could not also affect -CURRENT.
The change seems fine to me, but I'm unclear under what circumstances it would happen. (I have done multiple installs with ZFS root, and not run into this problem.)
A commit references this bug: Author: allanjude Date: Sat Jul 11 17:06:48 UTC 2020 New revision: 363101 URL: https://svnweb.freebsd.org/changeset/base/363101 Log: bsdinstall: don't fail if fstab is empty PR: 210865 Submitted by: Tim Lukasiewicz <eclipzetech08@gmail.com>, h-fujishima@sakura.ad.jp (original version) Reported by: h-fujishima@sakura.ad.jp Reviewed by: sef MFC after: 2 weeks Sponsored by: Klara Inc. Event: July 2020 Bugathon Changes: head/usr.sbin/bsdinstall/scripts/umount