summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-14 22:01:56 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-14 22:01:56 +0000
commitfd958fd611211977ee8227db08387b11ec8ada18 (patch)
tree1494b4ea0ec09b78f5175a4939b447c7a7a279f5 /usr
parent1c07024617aa817314e718fb912a60edfd024f2f (diff)
downloadpfsense-fd958fd611211977ee8227db08387b11ec8ada18.zip
pfsense-fd958fd611211977ee8227db08387b11ec8ada18.tar.gz
Do not modify boot.config on CDROM platform (RO)
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_advanced.php58
1 files changed, 30 insertions, 28 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index 4a46351..34015bf 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -229,38 +229,40 @@ if ($_POST) {
$boot_config = "";
$boot_config_split = split("\n", $boot_config);
- $fd = fopen("/boot.config","w");
- if($fd) {
- foreach($boot_config_split as $bcs) {
- if(stristr($bcs, "-D")) {
- /* DONT WRITE OUT, WE'LL DO IT LATER */
- } else {
- if($bcs <> "")
- fwrite($fd, "{$bcs}\n");
+ if($g['platform'] <> "cdrom") {
+ $fd = fopen("/boot.config","w");
+ if($fd) {
+ foreach($boot_config_split as $bcs) {
+ if(stristr($bcs, "-D")) {
+ /* DONT WRITE OUT, WE'LL DO IT LATER */
+ } else {
+ if($bcs <> "")
+ fwrite($fd, "{$bcs}\n");
+ }
}
+ if(isset($config['system']['enableserial'])) {
+ fwrite($fd, "-D");
+ }
+ fclose($fd);
}
- if(isset($config['system']['enableserial'])) {
- fwrite($fd, "-D");
- }
- fclose($fd);
- }
- /* serial console - write out /boot/loader.conf */
- $boot_config = file_get_contents("/boot/loader.conf");
- $boot_config_split = split("\n", $boot_config);
- $fd = fopen("/boot/loader.conf","w");
- if($fd) {
- foreach($boot_config_split as $bcs) {
- if(stristr($bcs, "console")) {
- /* DONT WRITE OUT, WE'LL DO IT LATER */
- } else {
- if($bcs <> "")
- fwrite($fd, "{$bcs}\n");
+ /* serial console - write out /boot/loader.conf */
+ $boot_config = file_get_contents("/boot/loader.conf");
+ $boot_config_split = split("\n", $boot_config);
+ $fd = fopen("/boot/loader.conf","w");
+ if($fd) {
+ foreach($boot_config_split as $bcs) {
+ if(stristr($bcs, "console")) {
+ /* DONT WRITE OUT, WE'LL DO IT LATER */
+ } else {
+ if($bcs <> "")
+ fwrite($fd, "{$bcs}\n");
+ }
}
+ if(isset($config['system']['enableserial'])) {
+ fwrite($fd, "console=\"comconsole\"\n");
+ }
+ fclose($fd);
}
- if(isset($config['system']['enableserial'])) {
- fwrite($fd, "console=\"comconsole\"\n");
- }
- fclose($fd);
}
conf_mount_ro();
OpenPOWER on IntegriCloud