diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-04-06 11:09:07 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-04-06 11:09:07 +0200 |
commit | ac5970e35e66605d0547bcd0f3ec7f3e177a2bb8 (patch) | |
tree | 363475b3141334c819396ce3bffefc46452734ad /package/base-files/src | |
parent | f073ed03ff3d9e40e142fd39632ee93dd7a4f1c7 (diff) | |
parent | 7762cd4b8597a42a8892d77bea8215a67fb5fbfc (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/base-files/src')
-rw-r--r-- | package/base-files/src/etc/init.d/fs | 58 |
1 files changed, 19 insertions, 39 deletions
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 |