From 3446ca38b0bde41112b0caa953aeb7c556bb4777 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 3 Nov 2005 18:25:43 +0000 Subject: MFC 7313 Setup serial console correctly Ticket #670 --- usr/local/www/system_advanced.php | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'usr/local/www') 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"); onclick="enable_change(false)" /> This will enable the first serial port with 9600/8/N/1 + Note: This will disable the internal video card/keyboard -- cgit v1.1