Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/common/bootimage Appease warnings `"expr 0 \* 1024 \...



details:   https://anonhg.NetBSD.org/src/rev/23ad7ddedbb3
branches:  trunk
changeset: 772965:23ad7ddedbb3
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jan 22 16:56:22 2012 +0000

description:
Appease warnings `"expr 0 \* 1024 \* 1024 / 512" returned non-zero status.'

SWAPMB could be zero (in install-image case) and
expr(1) returns exit status 1 in that case.  Umm.

diffstat:

 distrib/common/bootimage/Makefile.bootimage |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 629760b673bb -r 23ad7ddedbb3 distrib/common/bootimage/Makefile.bootimage
--- a/distrib/common/bootimage/Makefile.bootimage       Sun Jan 22 16:50:00 2012 +0000
+++ b/distrib/common/bootimage/Makefile.bootimage       Sun Jan 22 16:56:22 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
+#      $NetBSD: Makefile.bootimage,v 1.3 2012/01/22 16:56:22 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -146,8 +146,9 @@
 IMAGEMB?=      2048            # 2048MB
 SWAPMB?=       128             # 128MB
 
+# XXX: SWAPMB could be zero and expr(1) returns exit status 1 in that case
 IMAGESECTORS!= expr ${IMAGEMB} \* 1024 \* 1024 / 512
-SWAPSECTORS!=  expr ${SWAPMB} \* 1024 \* 1024 / 512
+SWAPSECTORS!=  expr ${SWAPMB} \* 1024 \* 1024 / 512 || true
 
 .if ${USE_MBR} == "no"
 LABELSECTORS?= 0
@@ -176,7 +177,7 @@
 
 # parameters for sunlabel
 FSCYLINDERS!=  expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \)
-SWAPCYLINDERS!=        expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \)
+SWAPCYLINDERS!=        expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true
 
 
 #



Home | Main Index | Thread Index | Old Index