fsck -A isn't all that portable, so just use one codepath.
This commit is contained in:
parent
9300fa240d
commit
b6b88d3a07
@ -5,6 +5,10 @@
|
|||||||
description="Check filesystems according to /etc/fstab for errors and \
|
description="Check filesystems according to /etc/fstab for errors and \
|
||||||
optionally repair them."
|
optionally repair them."
|
||||||
|
|
||||||
|
# Hard return to parse fstabinfo output
|
||||||
|
_IFS="
|
||||||
|
"
|
||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
need checkroot
|
need checkroot
|
||||||
@ -14,23 +18,23 @@ depend()
|
|||||||
|
|
||||||
do_checkfs()
|
do_checkfs()
|
||||||
{
|
{
|
||||||
local retval=0 mode="-p" opts= parts=
|
local retval=0 opts=
|
||||||
|
[ "${RC_UNAME}" = "Linux" ] && opts="-C0 -T"
|
||||||
|
|
||||||
ebegin "Checking all filesystems"
|
ebegin "Checking all filesystems"
|
||||||
|
|
||||||
if [ "${RC_UNAME}" = "Linux" ]; then
|
# Load our partitions into $@
|
||||||
opts="-A -C0 -R -T"
|
local IFS="$_IFS"
|
||||||
else
|
set -- $(fstabinfo --passno ">1")
|
||||||
parts="$(fstabinfo --passno ">1")"
|
unset IFS
|
||||||
if [ -z "${parts}" ]; then
|
if [ $# = 0 ]; then
|
||||||
eend 0
|
eend 0
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fsck ${opts} ${mode} ${parts}
|
fsck -p ${opts} "$@"
|
||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [ ${retval} -eq 0 ]; then
|
if [ ${retval} -eq 0 ]; then
|
||||||
eend 0
|
eend 0
|
||||||
elif [ ${retval} -eq 1 ]; then
|
elif [ ${retval} -eq 1 ]; then
|
||||||
@ -44,7 +48,7 @@ do_checkfs()
|
|||||||
else
|
else
|
||||||
if yesno ${rc_force_auto:-${RC_FORCE_AUTO}}; then
|
if yesno ${rc_force_auto:-${RC_FORCE_AUTO}}; then
|
||||||
eend 2 "Fsck could not correct all errors, rerunning"
|
eend 2 "Fsck could not correct all errors, rerunning"
|
||||||
fsck ${opts} -y ${parts}
|
fsck -y ${opts} "$@"
|
||||||
retval=$?
|
retval=$?
|
||||||
eend ${retval}
|
eend ${retval}
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user