diff options
author | Roy Marples <roy@marples.name> | 2008-02-20 00:33:38 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-02-20 00:33:38 +0000 |
commit | 5ddd32c06c6bd43aaf701193822d678f742c5e5a (patch) | |
tree | ad2a234f7f6c946efc0abbea232143e1a4ab66ac /init.d/fsck | |
parent | 7dec6f40250dfa9196e9139173e8ecb8387b85d5 (diff) |
Allow fsck to be multiplexed.
Diffstat (limited to 'init.d/fsck')
-rw-r--r-- | init.d/fsck | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/init.d/fsck b/init.d/fsck index e899accf..c2816b20 100644 --- a/init.d/fsck +++ b/init.d/fsck @@ -3,6 +3,8 @@ # All rights reserved. Released under the 2-clause BSD license. description="Check and repair filesystems according to /etc/fstab" +_ISF=" +" depend() { @@ -12,20 +14,32 @@ depend() start() { - local reboot_opts= fsck_opts= + local reboot_opts= fsck_opts= p= + + ebegin "Checking local filesystems" + for p in ${fsck_passno}; do + local IFS="${_IFS}" + case "${p}" in + [0-9]*) p="=${p}";; + esac + set -- "$@" "$(fstabinfo --passno "${p}")" + unset IFS + done if [ "${RC_UNAME}" = "Linux" ]; then - fsck_opts="-A -C0 -T" - if echo 2>/dev/null >/.test.$$; then - rm -f /.test.$$ - fsck_opts="${fsck_opts} -R" + fsck_opts="-C0 -T" + if [ -z "${fsck_passno}" ]; then + fsck_args=${fsck_args--A -p} + if echo 2>/dev/null >/.test.$$; then + rm -f /.test.$$ + fsck_opts="-R" + fi fi reboot_opts="-f" fi - ebegin "Checking local filesystems" trap : QUIT - fsck ${fsck_args--p} ${fsck_opts} + fsck ${fsck_args--p} ${fsck_opts} "$@" case $? in 0) eend 0; return 0;; 1) ewend 1 "Filesystems repaired"; return 0;; |