summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorallanjude <allanjude@FreeBSD.org>2016-07-03 01:22:59 +0000
committerallanjude <allanjude@FreeBSD.org>2016-07-03 01:22:59 +0000
commitb9500c49c647efdf71e0f67a26fca38159b9075d (patch)
tree609ea2e5c7efbfd26e43b5d1ca690bbe6b14b708 /usr.sbin
parentfb6d45592675d408f0eacb16da95a938d5e64cee (diff)
downloadFreeBSD-src-b9500c49c647efdf71e0f67a26fca38159b9075d.zip
FreeBSD-src-b9500c49c647efdf71e0f67a26fca38159b9075d.tar.gz
Fix an error in bsdinstall when ZFS installation uses a bootpool
A separate bootpool is used when the selected partition type is MBR or when the disk is GELI encrypted and a UEFI loader is selected. BIOS avoids the bootpool by using bootcode and loader that support GELI. bsdinstall did not remount the bootpool after creating the main pool, which caused an error when mkdir tried to create /boot/zfs PR: 210717 Approved by: re (gjb) Sponsored by: ScaleEngine Inc.
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot19
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index db28284..d2de12b 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -218,6 +218,7 @@ SWAP_GMIRROR_LABEL='gmirror label swap %s'
SYSCTL_ZFS_MIN_ASHIFT_12='sysctl vfs.zfs.min_auto_ashift=12'
UMOUNT='umount "%s"'
ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"'
+ZFS_MOUNT='zfs mount "%s"'
ZFS_SET='zfs set "%s" "%s"'
ZFS_UNMOUNT='zfs unmount "%s"'
ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s'
@@ -1350,13 +1351,6 @@ zfs_create_boot()
$BSDINSTALL_CHROOT$dir || return $FAILURE
done
- # Create symlink(s)
- if [ "$ZFSBOOT_BOOT_POOL" ]; then
- f_dprintf "$funcname: Creating /boot symlink for boot pool..."
- f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \
- $BSDINSTALL_CHROOT/boot || return $FAILURE
- fi
-
# Set bootfs property
local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"
f_dprintf "$funcname: Setting bootfs property..."
@@ -1396,7 +1390,16 @@ zfs_create_boot()
fi
fi
- # While this is apparently not needed, it seems to help MBR
+ # Remount bootpool and create symlink(s)
+ if [ "$ZFSBOOT_BOOT_POOL" ]; then
+ f_eval_catch $funcname zfs "$ZFS_MOUNT" "$bootpool_name" ||
+ return $FAILURE
+ f_dprintf "$funcname: Creating /boot symlink for boot pool..."
+ f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \
+ $BSDINSTALL_CHROOT/boot || return $FAILURE
+ fi
+
+ # zpool.cache is required to mount more than one pool at boot time
f_dprintf "$funcname: Configuring zpool.cache for zroot..."
f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs ||
return $FAILURE
OpenPOWER on IntegriCloud