Respect shutdown -F on Linux to force fsck, #59
This commit is contained in:
parent
425abe40c5
commit
c89b3763fb
@ -27,14 +27,18 @@ _reboot() {
|
|||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
local reboot_opts= fsck_opts= p=
|
local reboot_opts= fsck_opts= p= check_extra=
|
||||||
|
|
||||||
if [ -e /fastboot ]; then
|
if [ -e /fastboot ]; then
|
||||||
ewarn "Skipping fsck due to /fastboot"
|
ewarn "Skipping fsck due to /fastboot"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
if [ -e /forcefsck ]; then
|
||||||
|
fsck_opts="${fsck_opts} -f"
|
||||||
|
check_extra="(check forced)"
|
||||||
|
fi
|
||||||
|
|
||||||
ebegin "Checking local filesystems"
|
ebegin "Checking local filesystems ${check_extra}"
|
||||||
for p in ${fsck_passno}; do
|
for p in ${fsck_passno}; do
|
||||||
local IFS="${_IFS}"
|
local IFS="${_IFS}"
|
||||||
case "${p}" in
|
case "${p}" in
|
||||||
@ -45,7 +49,7 @@ start()
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ "${RC_UNAME}" = "Linux" ]; then
|
if [ "${RC_UNAME}" = "Linux" ]; then
|
||||||
fsck_opts="-C0 -T"
|
fsck_opts="${fsck_opts} -C0 -T"
|
||||||
if [ -z "${fsck_passno}" ]; then
|
if [ -z "${fsck_passno}" ]; then
|
||||||
fsck_args=${fsck_args--A -p}
|
fsck_args=${fsck_args--A -p}
|
||||||
if echo 2>/dev/null >/.test.$$; then
|
if echo 2>/dev/null >/.test.$$; then
|
||||||
|
@ -13,7 +13,7 @@ depend()
|
|||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
if echo 2>/dev/null >/.test.$$; then
|
if echo 2>/dev/null >/.test.$$; then
|
||||||
rm -f /.test.$$ /fastboot
|
rm -f /.test.$$ /fastboot /forcefsck
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ start()
|
|||||||
Linux) mount -n -o remount,rw /;;
|
Linux) mount -n -o remount,rw /;;
|
||||||
*) mount -u -o rw /;;
|
*) mount -u -o rw /;;
|
||||||
esac
|
esac
|
||||||
eend $? "Root filesystem could not be mounted read/write"
|
if eend $? "Root filesystem could not be mounted read/write"; then
|
||||||
rm -f /fastboot
|
rm -f /fastboot /forcefsck
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user