diff options
author | Matthias Hentges <oe@hentges.net> | 2006-11-07 23:00:27 +0000 |
---|---|---|
committer | Matthias Hentges <oe@hentges.net> | 2006-11-07 23:00:27 +0000 |
commit | dcd47fba440071a9a0546cfd1c8969f6388fbdf0 (patch) | |
tree | 01f12bd7cf6c019631c890278a1961571e75edfb /packages/initscripts/initscripts-1.0/checkroot.sh | |
parent | 3b7d18f95dbaaca9faa1ffcc9a780431e7351902 (diff) |
initscripts: checkroot.sh: enable auto-fsck on boot for ext2 and ext3 rootfs partitions * * * Untested in .dev! * * *
Diffstat (limited to 'packages/initscripts/initscripts-1.0/checkroot.sh')
-rwxr-xr-x | packages/initscripts/initscripts-1.0/checkroot.sh | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/packages/initscripts/initscripts-1.0/checkroot.sh b/packages/initscripts/initscripts-1.0/checkroot.sh index 3729072656..2c5ee971e9 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,40 @@ 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" + + 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>&- |