cleanup fsck error handling:
1. explain what each error means 2. remove 130 (128 + 2) which was presumably there because fsck_msdos did not handle SIGINT properly
This commit is contained in:
parent
358764c860
commit
3a24c02f26
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: fsck,v 1.7 2007/04/06 14:20:17 apb Exp $
|
||||
# $NetBSD: fsck,v 1.8 2008/02/24 01:05:35 christos Exp $
|
||||
#
|
||||
|
||||
# PROVIDE: fsck
|
||||
|
@ -16,41 +16,37 @@ fsck_start()
|
|||
{
|
||||
if [ -e /fastboot ]; then
|
||||
echo "Fast boot: skipping disk checks."
|
||||
else
|
||||
trap : 2 # Ignore SIGINT, SIGQUIT, so we
|
||||
trap : 3 # enter single-user mode on failure.
|
||||
|
||||
echo "Starting file system checks:"
|
||||
fsck $fsck_flags
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
2)
|
||||
stop_boot
|
||||
;;
|
||||
4)
|
||||
echo "Rebooting..."
|
||||
reboot
|
||||
echo "Reboot failed; help!"
|
||||
stop_boot
|
||||
;;
|
||||
8)
|
||||
echo "Automatic file system check failed; help!"
|
||||
stop_boot
|
||||
;;
|
||||
12)
|
||||
echo "Boot interrupted."
|
||||
stop_boot
|
||||
;;
|
||||
130)
|
||||
stop_boot
|
||||
;;
|
||||
*)
|
||||
echo "Unknown error; help!"
|
||||
stop_boot
|
||||
;;
|
||||
esac
|
||||
return
|
||||
fi
|
||||
trap : 2 # Ignore SIGINT, SIGQUIT, so we
|
||||
trap : 3 # enter single-user mode on failure.
|
||||
|
||||
echo "Starting file system checks:"
|
||||
fsck $fsck_flags
|
||||
local fsck_error="$?"
|
||||
case $fsck_error in
|
||||
0) # OK
|
||||
return
|
||||
;;
|
||||
2) # Needs re-run, still fs errors
|
||||
echo "file systems still have errors; re-run fsck manually!"
|
||||
;;
|
||||
4) # Root modified
|
||||
echo "Rebooting..."
|
||||
reboot
|
||||
echo "Reboot failed; help!"
|
||||
;;
|
||||
8) # Check failed
|
||||
echo "Automatic file system check failed; help!"
|
||||
;;
|
||||
12) # Got signal
|
||||
echo "Boot interrupted."
|
||||
;;
|
||||
*)
|
||||
echo "Unknown error $fsck_error; help!"
|
||||
;;
|
||||
esac
|
||||
stop_boot
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
|
|
Loading…
Reference in New Issue