From dd7e4d21cc74e5b3af872674db65a1dc21a2c3e2 Mon Sep 17 00:00:00 2001 From: Edwin Groothuis Date: Tue, 16 Jun 2009 12:33:38 +0000 Subject: [PATCH] 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 MFC after: 1 week --- tools/tools/nanobsd/nanobsd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 70c0c5833c4..cd6aa62aef9 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -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