summaryrefslogtreecommitdiffstats
path: root/package/e2fsprogs
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-26 22:45:39 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-26 22:45:39 +0000
commitfaf7173b4df3a152dbdc574751078b359c116d5b (patch)
tree446e5e5532100cf4c46d1bddfde0a688dbf1c153 /package/e2fsprogs
parenta35f8c947088b65dd1524938b59fb9b1e429807c (diff)
add the block-mount package by Daniel Dickinson (cshore), replacing existing automount functionality
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19877 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/e2fsprogs')
-rw-r--r--package/e2fsprogs/Makefile6
-rw-r--r--package/e2fsprogs/files/e2fsck.init35
-rw-r--r--package/e2fsprogs/files/e2fsck.sh35
3 files changed, 38 insertions, 38 deletions
diff --git a/package/e2fsprogs/Makefile b/package/e2fsprogs/Makefile
index bf744147b..3a08db323 100644
--- a/package/e2fsprogs/Makefile
+++ b/package/e2fsprogs/Makefile
@@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
-#
+# Copyright 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
@@ -156,8 +156,8 @@ define Package/e2fsprogs/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(foreach lib,com_err e2p,$(PKG_INSTALL_DIR)/usr/lib/lib$(lib).so.*) $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/e2fsck.init $(1)/etc/init.d/e2fsck
-
+ $(INSTALL_DIR) $(1)/lib/functions/fsck
+ $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
endef
define Package/libuuid/install
diff --git a/package/e2fsprogs/files/e2fsck.init b/package/e2fsprogs/files/e2fsck.init
deleted file mode 100644
index 4fa231296..000000000
--- 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 000000000..3b34239ce
--- /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"