summaryrefstree
path: root/usr/bin/try-mount-mmc
blob: 2ce1b1bba851a8821252a5b0830d9af77862e295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

#set -x

mount_mtd()
{
	id=$1;	
	path=$2;

	success="YES"
	copy="NO"

	# if file exist
	if [ -e /dev/mmcblk3p$id ] ; then
		
		if [ $id = "10" ] || [ $id = "13" ]; then		
			mount -o rw -t ext4 /dev/mmcblk3p${id}  $path  1>/dev/null 2>/dev/null
		else
			mount -o sync -t ext4 /dev/mmcblk3p${id}  $path  1>/dev/null 2>/dev/null
		fi
		if [ $? -ne 0 ] ; then 
			success="NO"
		fi
			
	else
		success="NO"
	fi

	if [ $success = "NO" ] ;then
		mount -t tmpfs tmpfs $path
		copy="YES"
	fi
	
	if [ $copy = "YES" ] ;then
		cp -fR /opt/${path}_base/* $path 
	fi
}


install -d /var/log
install -d /var/database
install -d /var/cache
install -d /etc/avnt
install -d /var/navilog
install -d /var/manual
install -d /var/DB
install -d /var/carlink

mount_mtd  6  "/var/log"
mount_mtd  7  "/var/database"
mount_mtd  8  "/var/cache"
mount_mtd  9  "/etc/avnt"
mount_mtd  10 "/var/navilog"
mount_mtd  11 "/var/manual"
mount_mtd  12 "/var/DB"
mount_mtd  13 "/var/carlink"

exit 0