diff options
Diffstat (limited to 'packages/initscripts/initscripts-1.0/checkroot.sh')
-rwxr-xr-x | packages/initscripts/initscripts-1.0/checkroot.sh | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/packages/initscripts/initscripts-1.0/checkroot.sh b/packages/initscripts/initscripts-1.0/checkroot.sh index 3729072656..df3035371b 100755 --- a/packages/initscripts/initscripts-1.0/checkroot.sh +++ b/packages/initscripts/initscripts-1.0/checkroot.sh @@ -24,7 +24,7 @@ test -x /sbin/update && update exec 9>&0 </etc/fstab rootmode=rw rootopts=rw -rootcheck=no +test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no" swap_on_md=no devfs= while read fs mnt type opts dump pass junk @@ -44,15 +44,43 @@ do test "$type" = swap && swap_on_md=yes ;; esac + test "$type" = devfs && devfs="$fs" - test "$mnt" != / && continue - rootopts="$opts" - test "$pass" = 0 -o "$pass" = "" && rootcheck=no - case "$opts" in - ro|ro,*|*,ro|*,ro,*) - rootmode=ro - ;; - esac + + # Currently we do not care about the other entries + if test "$mnt" = "/" + then + #echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]" + + rootopts="$opts" + roottype="$type" + + #The "spinner" is broken on busybox sh + TERM=dumb + + test "$pass" = 0 -o "$pass" = "" && rootcheck=no + + # Enable fsck for ext2 and ext3 rootfs, disable for everything else + case "$type" in + ext2|ext3) rootcheck=yes;; + *) rootcheck=no;; + esac + + if test "$rootcheck" = yes + then + if ! test -x "/sbin/fsck.${roottype}" + then + echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n" + rootcheck=no + fi + fi + + case "$opts" in + ro|ro,*|*,ro|*,ro,*) + rootmode=ro + ;; + esac + fi done exec 0>&9 9>&- @@ -122,6 +150,12 @@ else # if test "$?" -gt 1 then + + # Since this script is run very early in the boot-process, it should be safe to assume that the + # output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot + # messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal + chvt 1 + # Surprise! Re-directing from a HERE document (as in # "cat << EOF") won't work, because the root is read-only. echo |