From 5c105d9f3fd086aff195d3849dcf847d6b0bd927 Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 5 Oct 2012 10:12:53 +0000 Subject: branch Attitude Adjustment git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/e2fsprogs/files/e2fsck.conf | 3 +++ package/e2fsprogs/files/e2fsck.sh | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 package/e2fsprogs/files/e2fsck.conf create mode 100644 package/e2fsprogs/files/e2fsck.sh (limited to 'package/e2fsprogs/files') diff --git a/package/e2fsprogs/files/e2fsck.conf b/package/e2fsprogs/files/e2fsck.conf new file mode 100644 index 000000000..9c96b4958 --- /dev/null +++ b/package/e2fsprogs/files/e2fsck.conf @@ -0,0 +1,3 @@ +[options] +broken_system_clock = true + diff --git a/package/e2fsprogs/files/e2fsck.sh b/package/e2fsprogs/files/e2fsck.sh new file mode 100644 index 000000000..22031edb6 --- /dev/null +++ b/package/e2fsprogs/files/e2fsck.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Copyright 2010 Vertical Communications +# Copyright 2012 OpenWrt.org +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +fsck_e2fsck() { + set -o pipefail + e2fsck -p "$device" 2>&1 | logger -t "fstab: e2fsck ($device)" + local status="$?" + set +o pipefail + 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" -- cgit v1.2.3