m/node: also log to ttyS1
Some systems have their serial console connected to ttyS1, not ttyS0.
We currently have no way of passing this information to the system as we
lock down boot parameters and
there is significant risk in letting people change this, both in terms
of security (some kernel parameters can affect the integrity of the OS)
as well as availability as such a setting needs to be respected by both
A and B loaders, thus any misconfiguration could make the node
non-functional without an obvious way to roll back.
Thus this just adds ttyS1 to the list of serial consoles for the time
being. When we have such a mechanism, we'll likely undo the hardcoding
of all consoles anyways.
Fixes #216
Change-Id: I2f35edad049ceae1bb5cfc22b89bf6a1664cfbf8
Reviewed-on: https://review.monogon.dev/c/monogon/+/1625
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/core/minit/main.c b/metropolis/node/core/minit/main.c
index 4677c8e..d92f7ed 100644
--- a/metropolis/node/core/minit/main.c
+++ b/metropolis/node/core/minit/main.c
@@ -29,7 +29,7 @@
void handle_signal(pid_t child_pid, int signum);
-#define NUM_CONSOLES 3
+#define NUM_CONSOLES 4
FILE *consoles[NUM_CONSOLES] = {};
// open_consoles populates the consoles array with FILE pointers to opened
@@ -39,6 +39,7 @@
consoles[0] = fopen("/dev/console", "w");
consoles[1] = fopen("/dev/tty0", "w");
consoles[2] = fopen("/dev/ttyS0", "w");
+ consoles[3] = fopen("/dev/ttyS1", "w");
// Set all open consoles to be line-buffered.
for (int i = 0; i < NUM_CONSOLES; i++) {