summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-10-31 11:35:38 -0400
committerjim-p <jimp@pfsense.org>2011-10-31 11:35:38 -0400
commitc1becc31449ab147478fd05c8b139e00fddda729 (patch)
treed906c6782a6f2760a5fbe18f0316668bfce128da /etc/inc/pfsense-utils.inc
parent6661dbcf48ba73aac141cebd5efae3eb06a063c4 (diff)
downloadpfsense-c1becc31449ab147478fd05c8b139e00fddda729.zip
pfsense-c1becc31449ab147478fd05c8b139e00fddda729.tar.gz
Add field to the GUI to select the serial console speed (May work as-is, needs more testing/feedback)
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 45ad75b..f51ef58 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -961,12 +961,20 @@ function setup_serial_port() {
// Loop through and only add lines that are not empty, and which
// do not contain a console directive.
foreach($boot_config_split as $bcs)
- if(!empty($bcs) && (stripos($bcs, "console") === false))
+ if(!empty($bcs)
+ && (stripos($bcs, "console") === false)
+ && (stripos($bcs, "boot_multicons") === false)
+ && (stripos($bcs, "boot_serial") === false))
$new_boot_config[] = $bcs;
- if(isset($config['system']['enableserial']))
- $new_boot_config[] = 'console="comconsole"';
- file_put_contents("/boot/loader.conf", implode("\n", $new_boot_config));
+ if(isset($config['system']['enableserial'])) {
+ $serialspeed = (is_numeric($config['system']['serialspeed'])) ? $config['system']['serialspeed'] : "9600";
+ $new_boot_config[] = 'boot_multicons="YES"';
+ $new_boot_config[] = 'boot_serial="YES"';
+ $new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
+ $new_boot_config[] = 'console="comconsole,vidconsole"';
+ }
+ file_put_contents("/boot/loader.conf", implode("\n", $new_boot_config) . "\n");
}
}
$ttys = file_get_contents("/etc/ttys");
OpenPOWER on IntegriCloud