#!/bin/sh mount_mtd() { id=$1; vol=$2; size=$3; path=$4; mountsize=$5 success="YES" copy="NO" # if file exist if [ -e /dev/mtd$id ] ; then #try to mount ubiattach -d $id -m $id 1>/dev/null 2>/dev/null mount -o sync -t ubifs /dev/ubi${id}_0 $path 1>/dev/null 2>/dev/null 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 /etc/avnt install -d /var/cache mount_mtd 8 "log" "15MiB" "/var/log" "13MiB" mount_mtd 9 "DataBase" "100MiB" "/var/database" "80MiB" mount_mtd 10 "Configuration" "5MiB" "/etc/avnt" "4MiB" mount_mtd 11 "Cache" "50MiB" "/var/cache" "46MiB" exit 0