Skip to content

Commit c4e6187

Browse files
committed
Ensure correct value from/to SERIALCONSOLE
Ensure SERIALCONSOLE always have non-empty serial device like ttySX instead of sshserial. Default to ttyS1 if empty.
1 parent 63a1945 commit c4e6187

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Utils/Backends.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ sub save_serial_console {
6464
my $serialconsole = get_var('SERIALCONSOLE', '');
6565
return if ($serialconsole ne '');
6666
$serialconsole = get_var('SERIALDEV', 'ttyS1');
67+
$serialconsole = 'ttyS1' if ($serialconsole eq 'sshserial');
6768
set_var('SERIALCONSOLE', $serialconsole);
6869
bmwqemu::save_vars();
6970
}
7071

7172
sub get_serial_console {
72-
return get_var('SERIALCONSOLE', get_var('SERIALDEV', 'ttyS1'));
73+
return get_var('SERIALCONSOLE', 'ttyS1');
7374
}
7475

7576
sub set_sshserial_dev {

0 commit comments

Comments
 (0)