| 1 |
#!/sbin/runscript
|
| 2 |
# Copyright 1999-2005 Gentoo Foundation
|
| 3 |
# Distributed under the terms of the GNU General Public License v2
|
| 4 |
|
| 5 |
depend() {
|
| 6 |
need checkroot modules
|
| 7 |
}
|
| 8 |
|
| 9 |
start() {
|
| 10 |
local retval=0
|
| 11 |
|
| 12 |
# Start RAID/LVM/EVMS/DM volumes for /usr, /var, etc.
|
| 13 |
# NOTE: this should be done *before* mounting anything
|
| 14 |
[[ -z ${CDBOOT} ]] && start_volumes
|
| 15 |
|
| 16 |
# Setup dm-crypt mappings if any
|
| 17 |
start_addon dm-crypt
|
| 18 |
|
| 19 |
if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]] ; then
|
| 20 |
rm -f /fastboot
|
| 21 |
else
|
| 22 |
ebegin "Checking all filesystems"
|
| 23 |
if [[ -f /forcefsck ]] ; then
|
| 24 |
ewarn "A full fsck has been forced"
|
| 25 |
fsck -C -R -A -a -f
|
| 26 |
retval=$?
|
| 27 |
rm -f /forcefsck
|
| 28 |
else
|
| 29 |
fsck -C -T -R -A -a
|
| 30 |
retval=$?
|
| 31 |
fi
|
| 32 |
if [[ ${retval} -eq 0 ]] ; then
|
| 33 |
eend 0
|
| 34 |
elif [[ ${retval} -ge 1 && ${retval} -le 3 ]] ; then
|
| 35 |
ewend 1 "Filesystem errors corrected."
|
| 36 |
# Everything should be ok, so return a pass
|
| 37 |
return 0
|
| 38 |
else
|
| 39 |
if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then
|
| 40 |
eend 2 "Fsck could not correct all errors, rerunning"
|
| 41 |
fsck -C -T -R -A -a -y
|
| 42 |
retval=$?
|
| 43 |
fi
|
| 44 |
|
| 45 |
if [[ ${retval} -gt 3 ]] ; then
|
| 46 |
eend 2 "Fsck could not correct all errors, manual repair needed"
|
| 47 |
/sbin/sulogin ${CONSOLE}
|
| 48 |
fi
|
| 49 |
fi
|
| 50 |
fi
|
| 51 |
}
|
| 52 |
|
| 53 |
|
| 54 |
# vim:ts=4
|