| # convert 'mtdxx:' to 'xx' |
| [ $d = $1 ] && echo "${e#mtd}" |
| local device=/dev/mtdblock$mtd_no |
| mount -t jffs2 -o defaults,noatime $device $dir \ |
| || { echo "error mounting jffs2 on '$device' as '$dir'"; return 1; } |
| local device=/dev/mtd$mtd_no |
| echo "formating '$device' for jffs2" |
| flash_erase --jffs $device 0 0 |
| mount_jffs2 $mtd_no "$dir" |
| # Get MTD partition number |
| if [ $(cat /etc/platform) = "GFLT110" ]; then |
| CONFIG_MTD_NO=$(check_mtd $part_name) |
| mount_jffs2 $CONFIG_MTD_NO /config \ |
| || recover_jffs2 $CONFIG_MTD_NO /config |
| # /config must be writeable by non-root |
| if [ -e /config/DEBUG ]; then |
| echo "Enabling DEBUG mode because /config/DEBUG is set." >&2 |
| echo "Usage: $0 {start|stop|restart}" >&2 |