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.
This commit is contained in:
tsutsui 2012-01-22 16:56:22 +00:00
parent 99c3f09a00
commit 02828259e9
1 changed files with 4 additions and 3 deletions

View File

@ -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 @@ INSTALLBOOT_AFTER_DISKLABEL?= no
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 @@ SWAPOFFSET!= expr ${LABELSECTORS} + ${FSSECTORS}
# parameters for sunlabel
FSCYLINDERS!= expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \)
SWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \)
SWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true
#