You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
784 B
39 lines
784 B
15 years ago
|
#!/bin/sh
|
||
|
# Copyright 2010 Vertical Communications
|
||
13 years ago
|
# Copyright 2012 OpenWrt.org
|
||
15 years ago
|
# This is free software, licensed under the GNU General Public License v2.
|
||
|
# See /LICENSE for more information.
|
||
|
#
|
||
|
|
||
|
fsck_e2fsck() {
|
||
13 years ago
|
set -o pipefail
|
||
15 years ago
|
e2fsck -p "$device" 2>&1 | logger -t "fstab: e2fsck ($device)"
|
||
|
local status="$?"
|
||
13 years ago
|
set +o pipefail
|
||
15 years ago
|
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"
|