mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-23 22:24:39 +02:00
Add e2fsck init script - scans every ext2/ext3 mount from fstab
Signed-off-by: Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14301 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
14011b1e81
commit
11a76a5b66
@ -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
|
||||
|
35
package/e2fsprogs/files/e2fsck.init
Normal file
35
package/e2fsprogs/files/e2fsck.init
Normal file
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user