mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Workaround for conf_mount_rw/ro during boot to only allow it to change at the start and end. Fixes #1279
This commit is contained in:
parent
fc2c320e2c
commit
548be1fd66
@ -301,13 +301,16 @@ EOD;
|
||||
* null
|
||||
******/
|
||||
/* mount flash card read/write */
|
||||
function conf_mount_rw() {
|
||||
function conf_mount_rw($nobootcheck = false) {
|
||||
global $g;
|
||||
|
||||
/* do not mount on cdrom platform */
|
||||
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense")
|
||||
return;
|
||||
|
||||
if($g['booting'] && !$nobootcheck)
|
||||
return;
|
||||
|
||||
if (refcount_reference(1000) > 1)
|
||||
return;
|
||||
|
||||
@ -321,7 +324,7 @@ function conf_mount_rw() {
|
||||
|
||||
/* if the platform is soekris or wrap or pfSense, lets mount the
|
||||
* compact flash cards root.
|
||||
*/
|
||||
*/
|
||||
$status = mwexec("/sbin/mount -u -w -o sync,noatime /");
|
||||
/* we could not mount this correctly. kick off fsck */
|
||||
if($status <> 0) {
|
||||
@ -339,14 +342,14 @@ function conf_mount_rw() {
|
||||
* RESULT
|
||||
* null
|
||||
******/
|
||||
function conf_mount_ro() {
|
||||
function conf_mount_ro($nobootcheck = false) {
|
||||
global $g;
|
||||
|
||||
/* do not umount on cdrom or pfSense platforms */
|
||||
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense")
|
||||
return;
|
||||
|
||||
if($g['booting'])
|
||||
if($g['booting'] && !$nobootcheck)
|
||||
return;
|
||||
|
||||
if (refcount_unreference(1000) > 0)
|
||||
@ -852,4 +855,4 @@ function set_device_perms() {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@ -129,7 +129,7 @@ $memory = get_memory();
|
||||
$avail = $memory[0];
|
||||
echo " done.\n";
|
||||
|
||||
conf_mount_rw();
|
||||
conf_mount_rw(true);
|
||||
|
||||
/* save dmesg output to file */
|
||||
system_dmesg_save();
|
||||
@ -400,6 +400,6 @@ unset($g['booting']);
|
||||
|
||||
led_normalize();
|
||||
|
||||
conf_mount_ro();
|
||||
conf_mount_ro(true);
|
||||
|
||||
?>
|
||||
|
||||
6
etc/sshd
6
etc/sshd
@ -42,7 +42,7 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
conf_mount_rw();
|
||||
conf_mount_rw(true);
|
||||
|
||||
function file_size($file) {
|
||||
$size = filesize($file);
|
||||
@ -138,7 +138,7 @@
|
||||
|
||||
/* are we already running? if so exit */
|
||||
if(is_subsystem_dirty('sshdkeys')) {
|
||||
conf_mount_ro();
|
||||
conf_mount_ro(true);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -185,6 +185,6 @@
|
||||
exec("mkdir /conf/sshd");
|
||||
exec("/bin/cp -p /etc/ssh/ssh_host* /conf/sshd");
|
||||
}
|
||||
conf_mount_ro();
|
||||
conf_mount_ro(true);
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user