aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-22 12:07:43 +0200
committerTom Gundersen <teg@jklm.no>2011-06-22 23:17:01 +0200
commit495832e09c060ce3327cd19c1ddc2160182e82f8 (patch)
tree2a6a6e69775584005bbccefef63bd5ba14260d02 /rc.sysinit
parent5e4b8e09b2027ec58a089becdc156d6efb5484ed (diff)
downloadinitscripts-495832e09c060ce3327cd19c1ddc2160182e82f8.tar.xz
Move fsck stuff into functions to allow custom overrides (FS#18736)
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit51
1 files changed, 2 insertions, 49 deletions
diff --git a/rc.sysinit b/rc.sysinit
index b5d63ea..e08adc6 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -214,55 +214,8 @@ fi
NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs"
if [[ -x $(type -P fsck) ]]; then
- stat_busy "Checking Filesystems"
- fsck_reboot() {
- echo "Automatic reboot in progress..."
- umount -a
- mount -n -o remount,ro /
- reboot -f
- exit 0
- }
- FSCK_OUT=/dev/stdout
- FSCK_ERR=/dev/stdout
- FSCK_FD=
- FORCEFSCK=
- [[ -f /forcefsck ]] && FORCEFSCK="-- -f"
- for cmdarg in $(< /proc/cmdline); do
- [[ "$cmdarg" == forcefsck ]] && FORCEFSCK="-- -f" && break
- done
- run_hook sysinit_prefsck
- fsck -A -T -C$FSCK_FD -a -t "$NETFS,noopts=_netdev" $FORCEFSCK >$FSCK_OUT 2>$FSCK_ERR
- fsckret=$?
- if ((fsckret > 1)); then
- stat_fail
- fi
- run_hook sysinit_postfsck
- if (( ( fsckret & 2) == 2)); then
- echo
- echo "********************** REBOOT REQUIRED *********************"
- echo "* *"
- echo "* The system will be rebooted automatically in 15 seconds. *"
- echo "* *"
- echo "************************************************************"
- echo
- sleep 15
- fsck_reboot
- elif ((fsckret > 1 && fsckret != 32)); then
- echo
- echo "***************** FILESYSTEM CHECK FAILED ****************"
- echo "* *"
- echo "* Please repair manually and reboot. Note that the root *"
- echo "* file system is currently mounted read-only. To remount *"
- echo "* it read-write type: mount -n -o remount,rw / *"
- echo "* When you exit the maintenance shell the system will *"
- echo "* reboot automatically. *"
- echo "* *"
- echo "************************************************************"
- echo
- sulogin -p
- fsck_reboot
- fi
- stat_done
+ fsck_all
+ fsck_reboot $?
fi
stat_busy "Mounting Local Filesystems"