From 14249fdadd129ea95eecb9352d5a864c132d4f0c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 29 Jul 2005 21:48:43 +0000 Subject: [PATCH] Fsck if dirty --- etc/inc/config.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 8d4fcdb90b..7eb2e00265 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -278,12 +278,18 @@ function conf_mount_rw() { /* don't use mount -u anymore (doesn't sync the files properly and /bin/sync won't help either) */ - mwexec("/sbin/umount -f {$g['cf_path']}"); + $status = mwexec("/sbin/umount -f {$g['cf_path']}"); + while($status <> 0) { + mwexec("fsck -y"); + $status = mwexec("/sbin/umount -f {$g['cf_path']}"); + } + $status = mwexec("/sbin/mount -w -o noatime {$g['cf_path']}"); - while($status == -1) { + while($status <> 0) { mwexec("fsck -y"); $status = mwexec("/sbin/mount -w -o noatime {$g['cf_path']}"); } + /* if the platform is soekris or wrap, lets mount the compact flash card. */ if($g['platform'] == "wrap" or $g['platform'] == "net45xx") {