Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame^] | 1 | #!/sbin/sh |
| 2 | |
| 3 | um |
| 4 | if [ $? != "0" ]; then |
| 5 | echo "Unable to unmount!" |
| 6 | exit 1 |
| 7 | fi |
| 8 | |
| 9 | |
| 10 | case $1 in |
| 11 | repair) |
| 12 | if [ -e /dev/block/mmcblk0p2 ]; then |
| 13 | |
| 14 | e2fsck -yf /dev/block/mmcblk0p2 |
| 15 | else |
| 16 | echo "No ext partition found!" |
| 17 | exit 1 |
| 18 | fi |
| 19 | exit 0 |
| 20 | ;; |
| 21 | ext3) |
| 22 | if [ -e /dev/block/mmcblk0p2 ]; then |
| 23 | |
| 24 | e2fsck -yf /dev/block/mmcblk0p2 |
| 25 | tune2fs -c0 -i0 -j /dev/block/mmcblk0p2 |
| 26 | else |
| 27 | echo "No ext partition found!" |
| 28 | exit 1 |
| 29 | fi |
| 30 | exit 0 |
| 31 | ;; |
| 32 | ext4) |
| 33 | if [ -e /dev/block/mmcblk0p2 ]; then |
| 34 | |
| 35 | tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2 |
| 36 | e2fsck -fpDC0 /dev/block/mmcblk0p2 |
| 37 | else |
| 38 | echo "No ext partition found!" |
| 39 | exit 1 |
| 40 | fi |
| 41 | exit 0 |
| 42 | ;; |
| 43 | --) |
| 44 | exit 0 |
| 45 | ;; |
| 46 | esac |