From 044437abb465330ec8e70a5b9e99088f6b4c720b Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 12 Aug 2008 16:59:23 +0000 Subject: Use expr -e instead of expr to compute NANO_MEDIASIZE for Flash devices larger than 2GB to prevent an overflow [1]. Make case-insensitive comparison work for siliconsystems, soekris and transcend devices. PR: conf/126386 [1] Submitted by: Mark A [1] MFC after: 1 month --- tools/tools/nanobsd/FlashDevice.sub | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/tools/nanobsd/FlashDevice.sub b/tools/tools/nanobsd/FlashDevice.sub index 07d3ce6..e8b0736 100644 --- a/tools/tools/nanobsd/FlashDevice.sub +++ b/tools/tools/nanobsd/FlashDevice.sub @@ -117,7 +117,7 @@ sub_FlashDevice () { NANO_SECTS=63 ;; 4096|4096mb|4g) - NANO_MEDIASIZE=`expr 4097802240 / 512` + NANO_MEDIASIZE=`expr -e 4097802240 / 512` NANO_HEADS=16 NANO_SECTS=63 ;; @@ -128,9 +128,9 @@ sub_FlashDevice () { esac ;; siliconsystems) - case $2 in + case $a2 in 4096|4g) - NANO_MEDIASIZE=`expr 4224761856 / 512` + NANO_MEDIASIZE=`expr -e 4224761856 / 512` NANO_HEADS=16 NANO_SECTS=63 ;; @@ -141,7 +141,7 @@ sub_FlashDevice () { esac ;; soekris) - case $2 in + case $a2 in net4526 | 4526 | net4826 | 4826 | 64 | 64mb) NANO_MEDIASIZE=125056 NANO_HEADS=4 @@ -154,7 +154,7 @@ sub_FlashDevice () { esac ;; transcend) - case $2 in + case $a2 in dom064m) NANO_MEDIASIZE=125184 NANO_HEADS=4 -- cgit v1.1