aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-01-31 12:55:55 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-01-31 12:55:55 +0000
commit5a6de1e62864a5c1544b55896fd99bee3b497f87 (patch)
tree09fa49ed9ef19dc1f55dcb06b731a37cb9dc662f /package
parent4a21b1be1ab6dc7bd0424af408f91c65cb5316d8 (diff)
downloadupstream-5a6de1e62864a5c1544b55896fd99bee3b497f87.tar.gz
upstream-5a6de1e62864a5c1544b55896fd99bee3b497f87.tar.bz2
upstream-5a6de1e62864a5c1544b55896fd99bee3b497f87.zip
Add e2fsck init script - scans every ext2/ext3 mount from fstab
Signed-off-by: Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> SVN-Revision: 14301
Diffstat (limited to 'package')
-rw-r--r--package/e2fsprogs/Makefile5
-rw-r--r--package/e2fsprogs/files/e2fsck.init35
2 files changed, 39 insertions, 1 deletions
diff --git a/package/e2fsprogs/Makefile b/package/e2fsprogs/Makefile
index e01828eacb..b8bf345a91 100644
--- a/package/e2fsprogs/Makefile
+++ b/package/e2fsprogs/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
PKG_VERSION:=1.40.11
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/e2fsprogs
@@ -146,6 +146,9 @@ define Package/e2fsprogs/install
ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
$(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
+
endef
define Package/libuuid/install
diff --git a/package/e2fsprogs/files/e2fsck.init b/package/e2fsprogs/files/e2fsck.init
new file mode 100644
index 0000000000..e66750c910
--- /dev/null
+++ b/package/e2fsprogs/files/e2fsck.init
@@ -0,0 +1,35 @@
+#!/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)
+ /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
+}
+