Add a knob to let the user select which console (video or serial) is preferred in cases where there are multiple consoles present. Also provide a way to force this preference.

This commit is contained in:
jim-p 2014-02-14 11:02:03 -05:00
parent 407fbf455b
commit bf4e62acc7
2 changed files with 27 additions and 1 deletions

View File

@ -1020,7 +1020,15 @@ function setup_serial_port($when="save", $path="") {
$new_boot_config[] = 'boot_multicons="YES"';
$new_boot_config[] = 'boot_serial="YES"';
$new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
$new_boot_config[] = 'console="comconsole,vidconsole"';
$primaryconsole = isset($g['primaryconsole_force']) ? $g['primaryconsole_force'] : $config['system']['primaryconsole'];
switch ($primaryconsole) {
case "video":
$new_boot_config[] = 'console="vidconsole,comconsole"';
break;
case "serial":
default:
$new_boot_config[] = 'console="comconsole,vidconsole"';
}
} elseif ($g['platform'] == "nanobsd") {
$new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
}

View File

@ -63,6 +63,7 @@ $pconfig['noautocomplete'] = isset($config['system']['webgui']['noautocomplete']
$pconfig['althostnames'] = $config['system']['webgui']['althostnames'];
$pconfig['enableserial'] = $config['system']['enableserial'];
$pconfig['serialspeed'] = $config['system']['serialspeed'];
$pconfig['primaryconsole'] = $config['system']['primaryconsole'];
$pconfig['enablesshd'] = $config['system']['enablesshd'];
$pconfig['sshport'] = $config['system']['ssh']['port'];
$pconfig['sshdkeyonly'] = isset($config['system']['ssh']['sshdkeyonly']);
@ -157,6 +158,11 @@ if ($_POST) {
else
unset($config['system']['serialspeed']);
if ($_POST['primaryconsole'])
$config['system']['primaryconsole'] = $_POST['primaryconsole'];
else
unset($config['system']['primaryconsole']);
if ($_POST['nodnsrebindcheck'] == "yes")
$config['system']['webgui']['nodnsrebindcheck'] = true;
else
@ -549,6 +555,18 @@ function prot_change() {
<br/><?=gettext("Allows selection of different speeds for the serial console port."); ?>
</td>
</tr>
<?php if (!$g['primaryconsole_force'] && ($g['platform'] == "pfSense" || $g['platform'] == "cdrom" || file_exists("/etc/nano_use_vga.txt"))): ?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Primary Console")?></td>
<td width="78%" class="vtable">
<select name="primaryconsole" id="primaryconsole" class="formselect">
<option value="serial" <?php if ($pconfig['primaryconsole'] == "serial") echo "selected=\"selected\"";?>>Serial Console</option>
<option value="video" <?php if ($pconfig['primaryconsole'] == "video") echo "selected=\"selected\"";?>>VGA Console</option>
</select>
<br/><?=gettext("Select the preferred console if multiple consoles are present. The preferred console will show pfSense boot script output. All consoles display OS boot messages, console messages, and the console menu."); ?>
</td>
</tr>
<?php endif; ?>
<tr>
<td colspan="2" class="list" height="12">&nbsp;</td>
</tr>