From fb4ee845c9887abd92da377c28cbba061eaa0862 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Mar 2021 19:41:42 +0100 Subject: [PATCH] system: better logic for -h and -D #4231 --- src/etc/inc/system.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 716185818..7dd7e8a41 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -1123,7 +1123,14 @@ function system_login_configure($verbose = false) } if ($serial_enabled) { - @file_put_contents('/boot.config', "-S{$serialspeed} -D\n"); + $serial_options = ["-S{$serialspeed}"]; + if ($console_selection[0] == 'comconsole') { + $serial_options[] = '-h'; + } + if (in_array('vidconsole', $console_selection)) { + $serial_options[] = '-D'; + } + @file_put_contents('/boot.config', join(' ', $serial_options) . "\n"); $new_boot_config['comconsole_speed'] = '"' . $serialspeed . '"'; $new_boot_config['boot_serial'] = '"YES"'; } elseif (!$output_enabled) {