diff options
author | jim-p <jimp@pfsense.org> | 2012-11-12 15:41:36 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-11-12 15:41:36 -0500 |
commit | 7b2290139d7a52e2a77b76dcae6a524c1d959ecd (patch) | |
tree | 5c965a1636468e724c365043526fdebba7e4969e /etc | |
parent | 1bceebd0ea4feb40cd9a9f0179cd093734b26e7e (diff) | |
download | pfsense-7b2290139d7a52e2a77b76dcae6a524c1d959ecd.zip pfsense-7b2290139d7a52e2a77b76dcae6a524c1d959ecd.tar.gz |
Add button to switch between read/write and read-only on Diag > NanoBSD; Add setting to keep the media read/write at all times; Add indication of ro/rw status on Dashboard.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.lib.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index bcc26f5..dc57b41 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -302,13 +302,16 @@ EOD; ******/ /* mount flash card read/write */ function conf_mount_rw() { - global $g; + global $g, $config; /* do not mount on cdrom platform */ if($g['platform'] == "cdrom" or $g['platform'] == "pfSense") return; - if (refcount_reference(1000) > 1) + if (!isset($config['system']['nanobsd_force_rw']) && (refcount_reference(1000) > 1)) + return; + + if (isset($config['system']['nanobsd_force_rw']) && is_writable("/")) return; $status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}"); @@ -340,12 +343,12 @@ function conf_mount_rw() { * null ******/ function conf_mount_ro() { - global $g; + global $g, $config; /* Do not trust $g['platform'] since this can be clobbered during factory reset. */ $platform = trim(file_get_contents("/etc/platform")); /* do not umount on cdrom or pfSense platforms */ - if($platform == "cdrom" or $platform == "pfSense") + if($platform == "cdrom" or $platform == "pfSense" or isset($config['system']['nanobsd_force_rw'])) return; if (refcount_unreference(1000) > 0) |