packages/utils/hfsprogs/files/hfsfsck.sh
Florian Fainelli 197e6a5a1c hfsprogs: initial import
Adds supports for hfsprogs, allowing the creation and verification of
HFS/HFS+ filesystems.

This creates two selectable packages:
- hfsfsck
- mkhfs

A filesystem checking script is included with hfsfsck to allow OpenWrt
to check/repair filesystem errors.

Using Ubuntu's 332.25 sources plus their patches from debian/patches/.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
2015-03-27 22:18:15 -07:00

30 lines
646 B
Bash

#!/bin/sh
# Copyright 2015 OpenWrt.org
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
fsck_hfsfsck() {
hfsfsck "$device" 2>&1 | logger -t "fstab: hfsfsck ($device)"
local status="$?"
case "$status" in
0) ;; #success
4) reboot;;
8) echo "hfsfsck ($device): Warning! Uncorrected errors."| logger -t fstab
return 1
;;
*) echo "hfsfsck ($device): Error $status. Check not complete."| logger -t fstab;;
esac
return 0
}
fsck_hfs() {
fsck_hfsfsck "$@"
}
fsck_hfsplus() {
fsck_hfsfsck "$@"
}
append libmount_known_fsck "hfs"
append libmount_known_fsck "hfsplus"