summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2008-08-12 16:59:23 +0000
committerantoine <antoine@FreeBSD.org>2008-08-12 16:59:23 +0000
commit044437abb465330ec8e70a5b9e99088f6b4c720b (patch)
tree0695e13961ddbf7106fa8a49afe6929dcd0cd693 /tools
parent53c0d641ea4a88bd379bfda8a45bda6fd4c08f23 (diff)
downloadFreeBSD-src-044437abb465330ec8e70a5b9e99088f6b4c720b.zip
FreeBSD-src-044437abb465330ec8e70a5b9e99088f6b4c720b.tar.gz
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
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/nanobsd/FlashDevice.sub10
1 files changed, 5 insertions, 5 deletions
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
OpenPOWER on IntegriCloud