summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.lib.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-17 14:17:10 +0000
committerErmal <eri@pfsense.org>2010-03-17 14:17:10 +0000
commita45e27ba70e30d67e380da33f332cd686441788c (patch)
tree650c4238e46ef064ad220c564adcea5c6dd27823 /etc/inc/config.lib.inc
parent2ae24c22b8cadc261721425c629a10b604f5070e (diff)
downloadpfsense-a45e27ba70e30d67e380da33f332cd686441788c.zip
pfsense-a45e27ba70e30d67e380da33f332cd686441788c.tar.gz
Ticket #417. Fix installation on embedded by using a refcount system for the mount command.
Diffstat (limited to 'etc/inc/config.lib.inc')
-rw-r--r--etc/inc/config.lib.inc32
1 files changed, 8 insertions, 24 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index 0de03a7..61f76ea 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -43,8 +43,6 @@
pfSense_MODULE: config
*/
-$config_parsed = false;
-
/****f* config/encrypted_configxml
* NAME
* encrypted_configxml - Checks to see if config.xml is encrypted and if so, prompts to unlock.
@@ -296,8 +294,8 @@ function conf_mount_rw() {
/* do not mount on cdrom platform */
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense")
return;
-
- if (is_subsystem_dirty('mount'))
+
+ if (refcount_reference(1000) > 1)
return;
$status = mwexec("/sbin/mount -u -w {$g['cf_path']}");
@@ -311,15 +309,12 @@ function conf_mount_rw() {
/* if the platform is soekris or wrap or pfSense, lets mount the
* compact flash cards root.
*/
- if($g['platform'] == "wrap" or $g['platform'] == "net45xx"
- or $g['platform'] == "embedded" or $g['platform'] == "nanobsd") {
+ $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 -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 -u -w /");
- }
}
mark_subsystem_dirty('mount');
@@ -334,22 +329,11 @@ function conf_mount_rw() {
function conf_mount_ro() {
global $g;
- if($g['booting'] == true)
- return;
-
/* do not umount on cdrom or pfSense platforms */
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense")
return;
- /* firmare upgrade in progress */
- if (is_subsystem_dirty('firmwarelock'))
- return;
-
- /* do not umount if generating ssh keys */
- if (is_subsystem_dirty('sshdkeys'))
- return;
-
- if (!is_subsystem_dirty('mount'))
+ if (refcount_unreference(1000) > 0)
return;
clear_subsystem_dirty('mount');
OpenPOWER on IntegriCloud