summaryrefslogtreecommitdiffstats
path: root/prebuilt/fs
blob: 3092efe2a2efb6a86c02e49e2df15b2a04f82c97 (plain) (blame)
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
#!/sbin/sh

um
if [ $? != "0" ]; then
	echo "Unable to unmount!"
	exit 1
fi


case $1 in
    repair)
	if [ -e /dev/block/mmcblk0p2 ]; then

		e2fsck -yf /dev/block/mmcblk0p2
	else
		echo "No ext partition found!"
		exit 1
	fi
	exit 0
        ;;
    ext3)
	if [ -e /dev/block/mmcblk0p2 ]; then

		e2fsck -yf /dev/block/mmcblk0p2
		tune2fs -c0 -i0 -j /dev/block/mmcblk0p2
	else
		echo "No ext partition found!"
		exit 1
	fi
	exit 0
	;;
    ext4)
	if [ -e /dev/block/mmcblk0p2 ]; then

		tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
		e2fsck -fpDC0 /dev/block/mmcblk0p2
	else
		echo "No ext partition found!"
		exit 1
	fi
	exit 0
        ;;
    --)
	exit 0
        ;;
esac