| 1 |
#!/bin/sh |
#!/bin/sh |
| 2 |
# if / is tmpfs, we have an old or broken jffs2 |
|
| 3 |
# erase data partition and set flag between bootloader and kernel |
case $1 in |
| 4 |
{ mount|grep "on / type tmpfs" 1>&-; } && { |
autostart) |
| 5 |
mtd erase data |
exec $0 start |
| 6 |
jffs2root --clean |
;; |
| 7 |
reboot |
start) |
| 8 |
} |
# if / is tmpfs, we have an old or broken jffs2 |
| 9 |
|
# erase data partition and set flag between bootloader and kernel |
| 10 |
|
{ mount|grep "on / type tmpfs" 1>&-; } && { |
| 11 |
|
mtd erase data |
| 12 |
|
jffs2root --clean |
| 13 |
|
/bin/sync && /bin/busybox reboot -f |
| 14 |
|
} |
| 15 |
|
;; |
| 16 |
|
stop) |
| 17 |
|
echo "no stop function implemented..." |
| 18 |
|
;; |
| 19 |
|
*) |
| 20 |
|
echo "Usage: $0 {start | stop }" |
| 21 |
|
exit 1 |
| 22 |
|
;; |
| 23 |
|
esac |
| 24 |
|
exit $? |