summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-11-03 18:25:43 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-11-03 18:25:43 +0000
commit3446ca38b0bde41112b0caa953aeb7c556bb4777 (patch)
treeeb7d96cb9b3b1268a7e068ab629a76418fccdecf /usr
parentfc3a37e9b8a3c06749daa5d522204f78058a0454 (diff)
downloadpfsense-3446ca38b0bde41112b0caa953aeb7c556bb4777.zip
pfsense-3446ca38b0bde41112b0caa953aeb7c556bb4777.tar.gz
MFC 7313
Setup serial console correctly Ticket #670
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_advanced.php36
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>
OpenPOWER on IntegriCloud