The section in /usr/libexec/bsdinstall/zfsboot following the comment "Touch up permissions on the tmp directories" uses $BSDINSTALL_CHROOTDIR, but this variable is undefined. It should probably be $BSDINSTALL_CHROOT, if this chmods are needed at all (shouldn't they be handled by the distextract phase anyway?).
Allan, this seems right up your alley. Could you have a look?
The fix for this is pending commit approval: https://reviews.freebsd.org/D3061
A commit references this bug: Author: allanjude Date: Mon Jul 13 17:40:25 UTC 2015 New revision: 285482 URL: https://svnweb.freebsd.org/changeset/base/285482 Log: Fix a typo in bsdinstall A variable was misspelled resulting in chmod executing on the installer instead of on the target chroot PR: 191402 Submitted by: Martin Simmons <martin@lispworks.com> Approved by: brueffer MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3061 Changes: head/usr.sbin/bsdinstall/scripts/zfsboot
A commit references this bug: Author: allanjude Date: Mon Jul 20 16:17:44 UTC 2015 New revision: 285721 URL: https://svnweb.freebsd.org/changeset/base/285721 Log: MFC: r285482 A variable was misspelled resulting in chmod executing on the installer instead of on the target chroot PR: 191402 MFC: r285553 make /var/audit its own dataset so it is not part of the OS boot environment PR: 199864 MFC: r285554 Set a mountpoint on the root of the pool so user-created datasets have a mountpoint to inherit MFC: r285557 Make bsdinstall's zfsboot script align partitions to 4k/1m when the user requests it PR: 195174 Approved by: re (gjb), brueffer Relnotes: yes Sponsored by: ScaleEngine Inc. Changes: _U stable/10/ stable/10/usr.sbin/bsdinstall/scripts/zfsboot