From owner-svn-src-head@FreeBSD.ORG Sat Jan 8 20:25:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C86501065670; Sat, 8 Jan 2011 20:25:00 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B68E08FC0A; Sat, 8 Jan 2011 20:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08KP02M003273; Sat, 8 Jan 2011 20:25:00 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08KP0AX003269; Sat, 8 Jan 2011 20:25:00 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101082025.p08KP0AX003269@svn.freebsd.org> From: Josh Paetzel Date: Sat, 8 Jan 2011 20:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217164 - in head/usr.sbin/pc-sysinstall: backend backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 08 Jan 2011 20:25:00 -0000 Author: jpaetzel (ports committer) Date: Sat Jan 8 20:25:00 2011 New Revision: 217164 URL: http://svn.freebsd.org/changeset/base/217164 Log: More elegant way to detect MBR vs. GPT Submitted by: nwhitehorn Approved by: imp Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Sat Jan 8 19:50:13 2011 (r217163) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Sat Jan 8 20:25:00 2011 (r217164) @@ -60,14 +60,8 @@ if [ "$?" != "0" ] ; then fi # Display if this is GPT or MBR formatted -gpart show ${1} | grep "GPT" >/dev/null 2>/dev/null -if [ "$?" = "0" ] ; then - echo "${1}-format: GPT" - TYPE="GPT" -else - echo "${1}-format: MBR" - TYPE="MBR" -fi +TYPE=`gpart show ${1} | awk '/^=>/ { printf("%s",$5); }'` +echo "${1}-format: $TYPE" # Set some search flags PART="0" Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sat Jan 8 19:50:13 2011 (r217163) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sat Jan 8 20:25:00 2011 (r217164) @@ -180,12 +180,7 @@ get_disk_partitions() return fi - gpart show ${1} | grep "MBR" >/dev/null 2>/dev/null - if [ "$?" = "0" ] ; then - type="MBR" - else - type="GPT" - fi + type=`gpart show ${1} | awk '/^=>/ { printf("%s",$5); }'` SLICES="`gpart show ${1} | grep -v ${1} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d'`" for i in ${SLICES}