aboutsummaryrefslogtreecommitdiffstats
path: root/package/e2fsprogs/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/e2fsprogs/files')
-rw-r--r--package/e2fsprogs/files/e2fsck.init35
-rw-r--r--package/e2fsprogs/files/e2fsck.sh35
2 files changed, 35 insertions, 35 deletions
diff --git a/package/e2fsprogs/files/e2fsck.init b/package/e2fsprogs/files/e2fsck.init
deleted file mode 100644
index 4fa231296f..0000000000
--- a/package/e2fsprogs/files/e2fsck.init
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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
-}
-
diff --git a/package/e2fsprogs/files/e2fsck.sh b/package/e2fsprogs/files/e2fsck.sh
new file mode 100644
index 0000000000..3b34239ce7
--- /dev/null
+++ b/package/e2fsprogs/files/e2fsck.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright 2010 Vertical Communications
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+fsck_e2fsck() {
+ e2fsck -p "$device" 2>&1 | logger -t "fstab: e2fsck ($device)"
+ local status="$?"
+ case "$status" in
+ 0|1) ;; #success
+ 2) reboot;;
+ 4) echo "e2fsck ($device): Warning! Uncorrected errors."| logger -t fstab
+ return 1
+ ;;
+ *) echo "e2fsck ($device): Error $status. Check not complete."| logger -t fstab;;
+ esac
+ return 0
+}
+
+fsck_ext2() {
+ fsck_e2fsck "$@"
+}
+
+fsck_ext3() {
+ fsck_e2fsck "$@"
+}
+
+fsck_ext4() {
+ fsck_e2fsck "$@"
+}
+
+append libmount_known_fsck "ext2"
+append libmount_known_fsck "ext3"
+append libmount_known_fsck "ext4"