diff options
author | Roy Marples <roy@marples.name> | 2007-10-11 09:49:54 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-10-11 09:49:54 +0000 |
commit | 64d1dd9da0c80691a562dad932dbca37bcfd6195 (patch) | |
tree | a60690d2cdfec53ad9bbf85c8f53e250fc5920ea /init.d/checkroot | |
parent | 07c8f8cfde375df0601020ecd656dc825571f17b (diff) |
If / block device as in /etc/fstab does not exist, use /dev/root if it's available in checkroot, #171593.
Diffstat (limited to 'init.d/checkroot')
-rwxr-xr-x | init.d/checkroot | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/init.d/checkroot b/init.d/checkroot index a392ea36..a45265cf 100755 --- a/init.d/checkroot +++ b/init.d/checkroot @@ -36,7 +36,7 @@ root_rw() { } do_fsck() { - local retval=0 opts= + local retval=0 opts= root= case "${RC_UNAME}" in FreeBSD) opts="-F";; Linux) opts="-T -C0";; @@ -52,9 +52,12 @@ do_fsck() { return 0 fi + root=$(fstabinfo --blockdevice /) + [ ! -e "${root}" -a -e /dev/root ] && root=/dev/root + if [ -e /forcefsck ] || get_bootparam "forcefsck" ; then ebegin "Checking root filesystem (full fsck forced)" - fsck ${opts} -f -n / + fsck ${opts} -f -n "${root}" # /forcefsck isn't deleted because checkfs needs it. # it'll be deleted in that script. retval=$? @@ -63,7 +66,7 @@ do_fsck() { local pass=$(fstabinfo --passno /) if [ ${pass:-0} != "0" ] ; then ebegin "Checking root filesystem" - fsck ${opts} -p / + fsck ${opts} -p "${root}" retval=$? else ebegin "Skipping root filesystem check" "(fstab's passno == 0)" @@ -92,7 +95,7 @@ do_fsck() { else if [ "${RC_FORCE_AUTO}" = "yes" ] ; then eend 2 "Rerunning fsck in force mode" - fsck ${opts} -y / + fsck ${opts} -y "${root}" retval=$? else eend 2 "Filesystem couldn't be fixed :(" |