diff options
author | allanjude <allanjude@FreeBSD.org> | 2016-06-10 14:31:59 +0000 |
---|---|---|
committer | allanjude <allanjude@FreeBSD.org> | 2016-06-10 14:31:59 +0000 |
commit | 3bc130fc274b5cd2037e3dd2d408d30161ab9ba9 (patch) | |
tree | c295df4e771045761924b2a8b8dbd1cc50fa7135 /usr.sbin | |
parent | 8354d9c04d906e9cb529cb05cdb73b33afbf2448 (diff) | |
download | FreeBSD-src-3bc130fc274b5cd2037e3dd2d408d30161ab9ba9.zip FreeBSD-src-3bc130fc274b5cd2037e3dd2d408d30161ab9ba9.tar.gz |
Fix bsdinstall for root-on-zfs with MBR partitioning
Fix an error where vfs.root.mountfrom was not always set as required
when creating a bootpool. After the recent geliboot changes, it was only
set if the main pool was encrypted.
Also resolve an error where the bootpool was unmounted twice causing
bsdinstall to stop with an error message about the failed command.
Approved by: re (gjb)
Sponsored by: BSDCan Hacker Lounge
Diffstat (limited to 'usr.sbin')
-rwxr-xr-x | usr.sbin/bsdinstall/scripts/zfsboot | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 80e0614..db28284 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -1194,11 +1194,6 @@ zfs_create_boot() f_eval_catch $funcname chmod "$CHMOD_MODE" \ go-wrx "$bootpool/$zroot_key" || return $FAILURE - else - # Clean up - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - "$bootpool_name" || return $FAILURE - f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi fi @@ -1409,6 +1404,11 @@ zfs_create_boot() "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ "$zroot_name" || return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname printf "$PRINTF_CONF" \ + vfs.root.mountfrom "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + fi # # Set canmount=noauto so that the default Boot Environment (BE) does not # get mounted if a different BE is selected from the beastie menu @@ -1486,10 +1486,6 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$zroot_name/$zroot_bootfs\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - return $SUCCESS } |