summaryrefslogtreecommitdiffstats
path: root/dung-3.4.25-m2/common/mount-device.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dung-3.4.25-m2/common/mount-device.sh')
-rwxr-xr-xdung-3.4.25-m2/common/mount-device.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/dung-3.4.25-m2/common/mount-device.sh b/dung-3.4.25-m2/common/mount-device.sh
new file mode 100755
index 0000000..a5e4b78
--- /dev/null
+++ b/dung-3.4.25-m2/common/mount-device.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# mount devices
+
+echo "Mount devices"
+
+set -e
+#set -x
+
+if [ $# -ne 1 ]; then
+ echo "usage: $(basename $0) PATTERN" >& 2
+ exit 1
+fi
+
+DEV_DIR="$1"
+
+# Mount device
+if [ $DEV_DIR == "/mnt/sd0" ]; then
+ mount /dev/mmcblk1p1 /mnt/sd0/
+elif [ $DEV_DIR == "/mnt/sd1" ]; then
+ mount /dev/mmcblk2p1 /mnt/sd1/
+else
+ mount -t tmpfs -o size=450M tmpfs /tmp/temp/
+fi
+
+# Mount check
+if [ $? -eq 0 ];then
+ echo "Device have mounted"
+else
+ echo "Device mount is error" >&2
+ exit 1
+fi