From owner-svn-src-all@freebsd.org Sun Jul 3 01:23:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 652B3B8F0C2; Sun, 3 Jul 2016 01:23:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 199ED2DE7; Sun, 3 Jul 2016 01:23:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u631MxSq098576; Sun, 3 Jul 2016 01:22:59 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u631Mxs5098575; Sun, 3 Jul 2016 01:22:59 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607030122.u631Mxs5098575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 3 Jul 2016 01:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302319 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2016 01:23:00 -0000 Author: allanjude Date: Sun Jul 3 01:22:59 2016 New Revision: 302319 URL: https://svnweb.freebsd.org/changeset/base/302319 Log: 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. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jul 3 00:31:33 2016 (r302318) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jul 3 01:22:59 2016 (r302319) @@ -218,6 +218,7 @@ SWAP_GMIRROR_LABEL='gmirror label swap % 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