1#!/bin/sh
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
6### BEGIN INIT INFO
7# Provides:          checkfs
8# Required-Start:    checkroot
9# Required-Stop:
10# Default-Start:     S
11# Default-Stop:
12# Short-Description: Check all other file systems
13### END INIT INFO
14
15. /etc/default/rcS
16
17#
18# Check the rest of the filesystems.
19#
20if test ! -f /fastboot
21then
22    if test -f /forcefsck
23    then
24        force="-f"
25    else
26        force=""
27    fi
28    if test "$FSCKFIX"  = yes
29    then
30	fix="-y"
31    else
32	fix="-a"
33    fi
34    spinner="-C"
35    case "$TERM" in
36	dumb|network|unknown|"") spinner="" ;;
37    esac
38    test "`uname -m`" = "s390" && spinner="" # This should go away
39    test "$VERBOSE" != no && echo "Checking all filesystems..."
40    fsck $spinner -R -A $fix $force
41    if test "$?" -gt 1
42    then
43      echo
44      echo "fsck failed.  Please repair manually."
45      echo
46      echo "CONTROL-D will exit from this shell and continue system startup."
47      echo
48      # Start a single user shell on the console
49      /sbin/sulogin $CONSOLE
50    fi
51fi
52rm -f /fastboot /forcefsck
53
54: exit 0
55