summarylogtreecommitdiffstats
path: root/autofsck_hook
blob: 773c08844bc8a6a8983613b278af4c4ca34465eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/ash

run_hook () {
	eval "$(busybox sed 's/fsck_device/orig_fsck_device/' init_functions)"
	eval "fsck_device(){ auto_fsck_device \$1;}"
}
auto_fsck_device() {
	orig_fsck_device $1;
	RET=$?;
	if [ -n "$fsckret" ] && [ "$fsckret" -ne 255 ]; then
	        if bitfield_has_bit "$fsckret" 4; then
			fsck -a $1;
			if [ "$?" == "0" ];then
				return 0;
			fi;
		fi;
	fi;
	return $RET;
}