From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 22:22:20 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B081065670; Tue, 23 Jun 2009 22:22:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2258FC17; Tue, 23 Jun 2009 22:22:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NMMKKh092574; Tue, 23 Jun 2009 22:22:20 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NMMKCX092572; Tue, 23 Jun 2009 22:22:20 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906232222.n5NMMKCX092572@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 23 Jun 2009 22:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194782 - stable/7/tools/tools/nanobsd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 22:22:21 -0000 Author: edwin Date: Tue Jun 23 22:22:20 2009 New Revision: 194782 URL: http://svn.freebsd.org/changeset/base/194782 Log: Fix NanoBSD when the data partition size is defined as a negative number. It is possible to ask nanobsd.sh to create a 'data' partition, separate from the system or configuration partitions, and furthermore, by specifying a negative value for its size to request that it use all space unused by those partitions for its own size. Because the two lines of code that calculate how much space is available for this data partition are written in perl-like syntax, the awk code that does the processing performs the calculation incorrectly. [note - this was already fixed by r174936] Furthermore, a comparison later down fails to newfs the partition when the size is negative. PR: misc/127759 Submitted by: Cyrus Rahman Modified: stable/7/tools/tools/nanobsd/nanobsd.sh (contents, props changed) Modified: stable/7/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 23 22:19:27 2009 (r194781) +++ stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 23 22:22:20 2009 (r194782) @@ -474,7 +474,7 @@ create_i386_diskimage ( ) ( # XXX: fill from where ? # Create Data slice, if any. - if [ $NANO_DATASIZE -gt 0 ] ; then + if [ $NANO_DATASIZE -ne 0 ] ; then newfs ${NANO_NEWFS} /dev/${MD}s4 # XXX: fill from where ? fi