From 8a66cbc86ce3ddaf29df0217b96e46e4cae935e9 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 18 Nov 2005 00:06:37 +0000 Subject: MFC 7768 Use mount -u instead of umount -f way for remounting filesystem ro or rw. --- etc/inc/config.inc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'etc/inc/config.inc') diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 6734c09..c8ce335 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -292,14 +292,10 @@ function conf_mount_rw() { if($g['platform'] == "cdrom") return; - /* don't use mount -u anymore - (doesn't sync the files properly and /bin/sync won't help either) */ - $status = mwexec("/sbin/umount -f {$g['cf_path']}"); - - $status = mwexec("/sbin/mount -w -o noatime {$g['cf_path']}"); + $status = mwexec("/sbin/mount -u -w {$g['cf_path']}"); if($status <> 0) { mwexec("/sbin/fsck -y {$g['cf_path']}"); - $status = mwexec("/sbin/mount -w -o noatime {$g['cf_path']}"); + $status = mwexec("/sbin/mount -u -w {$g['cf_path']}"); } /* if the platform is soekris or wrap or pfSense, lets mount the @@ -307,13 +303,12 @@ function conf_mount_rw() { */ if($g['platform'] == "wrap" or $g['platform'] == "net45xx" or $g['platform'] == "embedded") { - mwexec("/sbin/umount -f /"); - $status = mwexec("/sbin/mount -w /"); + $status = mwexec("/sbin/mount -u -w /"); /* we could not mount this correctly. kick off fsck */ if($status <> 0) { log_error("File system is dirty. Launching FSCK for /"); mwexec("/sbin/fsck -y"); - $status = mwexec("/sbin/mount -w /"); + $status = mwexec("/sbin/mount -u -w /"); } } } @@ -338,15 +333,16 @@ function conf_mount_ro() { if($g['platform'] == "cdrom") return; - mwexec("/sbin/umount -f {$g['cf_path']}"); - mwexec("/sbin/mount -r {$g['cf_path']}"); + mwexec("/sbin/mount -u -r {$g['cf_path']}"); /* if the platform is soekris or wrap, lets unmount the * compact flash card. */ if($g['platform'] == "wrap" or $g['platform'] == "net45xx" or $g['platform'] == "embedded") { - mwexec("/sbin/umount -f /"); - mwexec("/sbin/mount -f -r /"); + mwexec("/bin/sync"); + mwexec("/bin/sync"); + mwexec("/bin/sync"); + mwexec("/sbin/mount -u -r /"); } } -- cgit v1.1