aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xload_nandsim.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/load_nandsim.sh b/load_nandsim.sh
index 87d4f60..1df3813 100755
--- a/load_nandsim.sh
+++ b/load_nandsim.sh
@@ -13,11 +13,8 @@ fatal()
exit 1
}
-if grep -q "NAND simulator" /proc/mtd; then
- fatal "nandsim is already loaded"
-fi
-
-if [ "$#" -lt "1" ]; then
+usage()
+{
cat 1>&2 <<EOF
Load NAND simulator to simulate flash of a specified size.
@@ -58,6 +55,14 @@ Only the following combinations are supported:
| 1024 | 512 | 2048 |
--------------------------------------------------
EOF
+}
+
+if grep -q "NAND simulator" /proc/mtd; then
+ fatal "nandsim is already loaded"
+fi
+
+if [ "$#" -lt "1" ]; then
+ usage
exit 1
fi