Commit c6c30530 authored by Franco Fichtner's avatar Franco Fichtner

system: modernise console setting

(cherry picked from commit 50b5de04)
(cherry picked from commit 2cf06c64)
parent 0a6fbdd8
......@@ -216,6 +216,7 @@
<protocol>https</protocol>
</webgui>
<disablenatreflection>yes</disablenatreflection>
<usevirtualterminal>1</usevirtualterminal>
<disableconsolemenu/>
<disablechecksumoffloading>1</disablechecksumoffloading>
<disablesegmentationoffloading>1</disablesegmentationoffloading>
......
......@@ -1712,7 +1712,7 @@ function system_login_configure($verbose = false)
$new_boot_config['comconsole_speed'] = null;
$new_boot_config['boot_multicons'] = null;
$new_boot_config['boot_serial'] = null;
$new_boot_config['kern.vty'] = '"vt"';
$new_boot_config['kern.vty'] = null;
$new_boot_config['console'] = null;
$console_types = system_console_types();
......@@ -1776,7 +1776,7 @@ function system_login_configure($verbose = false)
$fd = fopen('/etc/ttys', 'w');
$on_off_secure_u = $serial_enabled ? 'onifconsole secure' : 'off secure';
$on_off_secure_v = $virtual_enabled ? 'on secure' : 'off secure';
$terminal_type = 'cons25'; /* XXX standard is 'xterm' for virtual, 'vt100' for serial */
/* XXX serial type uses 3wire nowadays */
if (isset($config['system']['disableconsolemenu'])) {
$console_type = 'Pc';
$serial_type = 'std.' . $serialspeed;
......@@ -1785,23 +1785,17 @@ function system_login_configure($verbose = false)
$serial_type = 'al.' . $serialspeed;
}
foreach ($etc_ttys_lines as $tty) {
/* first virtual terminal */
if (strpos($tty, 'ttyv0') === 0) {
fwrite($fd, "ttyv0\t\"/usr/libexec/getty {$console_type}\"\t\t{$terminal_type}\t${on_off_secure_v}\n");
continue;
}
/* all other virtual terminals */
foreach (array('ttyv1', 'ttyv2', 'ttyv3', 'ttyv4', 'ttyv5', 'ttyv6', 'ttyv7') as $virtualport) {
/* virtual terminals */
foreach (array('ttyv0', 'ttyv1', 'ttyv2', 'ttyv3', 'ttyv4', 'ttyv5', 'ttyv6', 'ttyv7') as $virtualport) {
if (strpos($tty, $virtualport) === 0) {
fwrite($fd, "${virtualport}\t\"/usr/libexec/getty {$console_type}\"\t\txterm\t${on_off_secure_v}\n");
continue 2;
}
}
/* each serial terminal */
/* serial terminals */
foreach (array('ttyu0', 'ttyu1', 'ttyu2', 'ttyu3') as $serialport) {
if (strpos($tty, $serialport) === 0) {
fwrite($fd, "{$serialport}\t\"/usr/libexec/getty {$serial_type}\"\t{$terminal_type}\t{$on_off_secure_u}\n");
/* skip to next line in outer loop */
fwrite($fd, "{$serialport}\t\"/usr/libexec/getty {$serial_type}\"\tvt100\t{$on_off_secure_u}\n");
continue 2;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment