summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/Makefile2
-rw-r--r--package/base-files/src/etc/init.d/fs58
2 files changed, 20 insertions, 40 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 2d3525b58..c9a343d59 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk
PKG_NAME:= base-files
PKG_VERSION:= 1.0
-PKG_RELEASE:= 81
+PKG_RELEASE:= 82
PKG_SECTION:= base
PKG_DESCR:= basic files and scripts
diff --git a/package/base-files/src/etc/init.d/fs b/package/base-files/src/etc/init.d/fs
index 8f4397897..e995422ee 100644
--- a/package/base-files/src/etc/init.d/fs
+++ b/package/base-files/src/etc/init.d/fs
@@ -8,46 +8,26 @@
# activate any logical volumes
[ -x /usr/sbin/lvm ] && { lvm vgscan; lvm vgchange -ay; }
+fstypes="ext2 ext3 ext4 xfs"
+
# filesystem checks
-[ -x /sbin/fsck.ext2 ] && {
- for i in $(grep -v "^#" /etc/fstab|grep ext2|awk '{ print $1}');do fsck.ext2 $i;done;
-}
-[ -x /sbin/fsck.ext3 ] && {
- for i in $(grep -v "^#" /etc/fstab|grep ext3|awk '{ print $1}');do fsck.ext3 $i;done;
-}
-[ -x /sbin/fsck.ext4 ] && {
- for i in $(grep -v "^#" /etc/fstab|grep ext4|awk '{ print $1}');do fsck.ext4 $i;done;
-}
-[ -x /sbin/fsck.xfs ] && {
- for i in $(grep -v "^#" /etc/fstab|grep xfs|awk '{ print $1}');do xfs_repair $i;done;
-}
-# local filesystems
-grep ext2 /proc/filesystems >/dev/null 2>&1
-if [ $? -eq 0 ];then
- grep -v "^#" /etc/fstab |grep ext2 >/dev/null 2>&1
- if [ $? -eq 0 ];then
- mount -a -t ext2
- fi
-fi
-grep ext3 /proc/filesystems >/dev/null 2>&1
-if [ $? -eq 0 ];then
- grep -v "^#" /etc/fstab |grep ext3 >/dev/null 2>&1
- if [ $? -eq 0 ];then
- mount -a -t ext3
- fi
-fi
-grep ext4 /proc/filesystems >/dev/null 2>&1
-if [ $? -eq 0 ];then
- grep -v "^#" /etc/fstab |grep ext4 >/dev/null 2>&1
- if [ $? -eq 0 ];then
- mount -a -t ext4
- fi
-fi
-grep xfs /proc/filesystems >/dev/null 2>&1
-if [ $? -eq 0 ];then
- grep -v "^#" /etc/fstab |grep xfs >/dev/null 2>&1
+for fs in $fstypes; do
+ [ -x /usr/sbin/fsck.$fs ] && {
+ for i in $(grep -v "^#" /etc/fstab|grep $fs|awk '{ print $1}');do
+ echo "Checking filesystem on $i with $fs"
+ fsck -p -t $fs $i
+ done
+ }
+done
+
+# mount local filesystems
+for fs in $fstypes; do
+ grep $fs /proc/filesystems >/dev/null 2>&1
if [ $? -eq 0 ];then
- mount -a -t xfs
+ grep -v "^#" /etc/fstab |grep $fs >/dev/null 2>&1
+ if [ $? -eq 0 ];then
+ mount -a -t $fs
+ fi
fi
-fi
+done
exit 0