From owner-svn-src-head@freebsd.org Fri Jun 10 14:32:00 2016 Return-Path: Delivered-To: svn-src-head@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 B830AB7115C; Fri, 10 Jun 2016 14:32: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 6D06D1442; Fri, 10 Jun 2016 14:32: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 u5AEVxir040516; Fri, 10 Jun 2016 14:31:59 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEVxUJ040515; Fri, 10 Jun 2016 14:31:59 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606101431.u5AEVxUJ040515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 10 Jun 2016 14:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301787 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:32:00 -0000 Author: allanjude Date: Fri Jun 10 14:31:59 2016 New Revision: 301787 URL: https://svnweb.freebsd.org/changeset/base/301787 Log: 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 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 10 14:31:03 2016 (r301786) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 10 14:31:59 2016 (r301787) @@ -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 }