Skip to content

Commit

Permalink
loader: comconsole: don't unconditionally wipe out hw.uart.console
Browse files Browse the repository at this point in the history
It may be the case that we need to set hw.uart.console manually in some
scenarios that comconsole can't necessarily support.  Avoid clobbering
hw.uart.console unless we've actually selected comconsole so that one
could at least get kernel console output..

Discussed with:	imp
Sponsored by:	Zenith Electronics LLC
Sponsored by:	Klara, Inc.

(cherry picked from commit ec671f4)
(cherry picked from commit 362677cae8e9ac4c6f7ff4d74a4378ea11d47797)

Approved by:    so
Security:       FreeBSD-EN-23:06.loader
  • Loading branch information
kevans91 authored and fichtner committed Jun 21, 2023
1 parent 38ceff9 commit 74c47d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stand/i386/libi386/comconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,13 @@ comc_setup(int speed, int port)
char intbuf[64];
int tries;

unsetenv("hw.uart.console");
comc_curspeed = speed;
comc_port = port;
if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0)
return;

unsetenv("hw.uart.console");

#define COMC_TEST 0xbb
/*
* Write byte to scratch register and read it out.
Expand Down

0 comments on commit 74c47d9

Please sign in to comment.