diff options
author | jim-p <jimp@pfsense.org> | 2014-02-14 11:02:03 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2014-02-14 11:02:03 -0500 |
commit | 01c1576292cff8c367da2c9f1916f58506e39cdf (patch) | |
tree | 78fae0362eb3c9dae31786839ee67c183e08658a | |
parent | 9525f7a6c8175bf6de9f0d70254f17d63f3af93a (diff) | |
download | pfsense-01c1576292cff8c367da2c9f1916f58506e39cdf.zip pfsense-01c1576292cff8c367da2c9f1916f58506e39cdf.tar.gz |
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.
-rw-r--r-- | etc/inc/pfsense-utils.inc | 10 | ||||
-rw-r--r-- | usr/local/www/system_advanced_admin.php | 18 |
2 files changed, 27 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 0737946..cd03d69 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1016,7 +1016,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 . '"'; } diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index 01e64f0..d2074d7 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -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"> </td> </tr> |