From owner-svn-src-head@FreeBSD.ORG Mon Nov 11 02:13:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3E997681; Mon, 11 Nov 2013 02:13:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AD282176; Mon, 11 Nov 2013 02:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAB2DmmS024356; Mon, 11 Nov 2013 02:13:48 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAB2DmiA024355; Mon, 11 Nov 2013 02:13:48 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311110213.rAB2DmiA024355@svn.freebsd.org> From: Devin Teske Date: Mon, 11 Nov 2013 02:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257939 - 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.14 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: Mon, 11 Nov 2013 02:13:48 -0000 Author: dteske Date: Mon Nov 11 02:13:47 2013 New Revision: 257939 URL: http://svnweb.freebsd.org/changeset/base/257939 Log: Check the partition scheme before blowing away disks, instead of after. The effects of this patch would only be noticeable if you were purposefully setting a bad value and trying to see what happens; and leaving the disks intact if a bad value has been set seems fair. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Nov 11 02:02:05 2013 (r257938) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Nov 11 02:13:47 2013 (r257939) @@ -645,6 +645,18 @@ zfs_create_diskpart() fi f_dprintf "$funcname: disk=[%s] index=[%s]" "$disk" "$index" + # Check for unknown partition scheme before proceeding further + case "$ZFSBOOT_PARTITION_SCHEME" in + ""|MBR|GPT) : known good ;; + *) + f_dprintf "$funcname: %s is an unsupported partition scheme" \ + "$ZFSBOOT_PARTITION_SCHEME" + msg_error="$msg_error: $funcname" f_show_err \ + "$msg_unsupported_partition_scheme" \ + "$ZFSBOOT_PARTITION_SCHEME" + return $FAILURE + esac + # # Destroy whatever partition layout is currently on disk. # NOTE: `-F' required to destroy if partitions still exist. @@ -824,14 +836,6 @@ zfs_create_diskpart() fi ;; - *) - f_dprintf "$funcname: %s is an unsupported partition scheme" \ - "$ZFSBOOT_PARTITION_SCHEME" - msg_error="$msg_error: $funcname" f_show_err \ - "$msg_unsupported_partition_scheme" \ - "$ZFSBOOT_PARTITION_SCHEME" - return $FAILURE - esac # $ZFSBOOT_PARTITION_SCHEME return $SUCCESS