From bf4e62acc78983e8769b4255bd7def587b01fd24 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 14 Feb 2014 11:02:03 -0500 Subject: [PATCH] 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. --- etc/inc/pfsense-utils.inc | 10 +++++++++- usr/local/www/system_advanced_admin.php | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 52c4519f3c..4334783c79 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -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 . '"'; } diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index 01e64f08f1..d2074d7e45 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() {
+ + + + + +
+ + +