1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-01 05:45:20 +02:00
openwrt-xburst/package/e2fsprogs/files/e2fsck.init
florian 49d65e7058 [package] update e2fsprogs to 1.41.9, add support for ext4 (#5748)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17427 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-08-27 09:16:54 +00:00

36 lines
625 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
# Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
START=15
e2fsck() {
local args
local cfg="$1"
config_get device "$cfg" device
[ -b "$device" ] || return 0
config_get fstype "$cfg" fstype
case "$fstype" in
ext2|ext3|ext4)
/usr/sbin/e2fsck -p "$device"
local status="$?"
case "$status" in
0|1) continue;;
2) reboot;;
4) echo "e2fsck ($device): Warning! Uncorrected errors.";;
*) echo "e2fsck ($device): Error $status. Check not complete.";;
esac
;;
*)
;;
esac
}
start() {
config_load fstab
config_foreach e2fsck mount
}