From b6b88d3a07a921de7450a529769a02f0b86cb7db Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 31 Jan 2008 13:19:04 +0000 Subject: fsck -A isn't all that portable, so just use one codepath. --- init.d/checkfs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/init.d/checkfs b/init.d/checkfs index 31982c88..4f8004db 100755 --- a/init.d/checkfs +++ b/init.d/checkfs @@ -5,6 +5,10 @@ description="Check filesystems according to /etc/fstab for errors and \ optionally repair them." +# Hard return to parse fstabinfo output +_IFS=" +" + depend() { need checkroot @@ -14,23 +18,23 @@ depend() do_checkfs() { - local retval=0 mode="-p" opts= parts= - + local retval=0 opts= + [ "${RC_UNAME}" = "Linux" ] && opts="-C0 -T" + ebegin "Checking all filesystems" - if [ "${RC_UNAME}" = "Linux" ]; then - opts="-A -C0 -R -T" - else - parts="$(fstabinfo --passno ">1")" - if [ -z "${parts}" ]; then - eend 0 - return 0 - fi + # Load our partitions into $@ + local IFS="$_IFS" + set -- $(fstabinfo --passno ">1") + unset IFS + if [ $# = 0 ]; then + eend 0 + return 0 fi - fsck ${opts} ${mode} ${parts} + fsck -p ${opts} "$@" retval=$? - + if [ ${retval} -eq 0 ]; then eend 0 elif [ ${retval} -eq 1 ]; then @@ -44,7 +48,7 @@ do_checkfs() else if yesno ${rc_force_auto:-${RC_FORCE_AUTO}}; then eend 2 "Fsck could not correct all errors, rerunning" - fsck ${opts} -y ${parts} + fsck -y ${opts} "$@" retval=$? eend ${retval} fi -- cgit v1.2.3