diff options
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_advanced.php | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php index 1d30051..465696c 100755 --- a/usr/local/www/system_advanced.php +++ b/usr/local/www/system_advanced.php @@ -216,27 +216,46 @@ if ($_POST) { $retval |= interfaces_optional_configure(); config_unlock(); - /* serial console */ + conf_mount_rw(); + + /* serial console - write out /boot.config */ if(file_exists("/boot.config")) $boot_config = file_get_contents("/boot.config"); else $boot_config = ""; $boot_config_split = split("\n", $boot_config); - - conf_mount_rw(); - $fd = fopen("/boot.config","w"); if($fd) { foreach($boot_config_split as $bcs) { if(stristr($bcs, "-D")) { - if(isset($config['system']['enableserial'])) { - fwrite($fd, "-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); + } + /* 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 { - fwrite($fd, "{$bcs}\n"); + if($bcs <> "") + fwrite($fd, "{$bcs}\n"); } } + if(isset($config['system']['enableserial'])) { + fwrite($fd, "console=\"comconsole\"\n"); + } fclose($fd); } @@ -273,6 +292,7 @@ include("head.inc"); <td width="78%" class="vtable"> <input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" /> <strong>This will enable the first serial port with 9600/8/N/1</strong> + <span class="vexpl">Note: This will disable the internal video card/keyboard</span> </td> </tr> <tr> |