From 0059b8442e803b917037495f5dc8c007391b1776 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 5 Feb 2023 19:04:42 +0000 Subject: [PATCH] bootloaders: Configure serial console in GRUB Signed-off-by: Michael Tremer --- src/python/bootloaders.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/python/bootloaders.py b/src/python/bootloaders.py index 883edfc..3836f98 100644 --- a/src/python/bootloaders.py +++ b/src/python/bootloaders.py @@ -137,9 +137,15 @@ class Grub(Bootloader): # Enable the serial console if self.bricklayer.settings.get("serial-console"): + device = self.bricklayer.settings.get("serial-console-device") + baudrate = self.bricklayer.settings.get("serial-console-baudrate") + + # Find out on which console we are running + unit = device.removeprefix("ttyS") + conf |= { "GRUB_TERMINAL_OUTPUT" : "\"serial console\"", - "GRUB_SERIAL_COMMAND" : "\"serial --unit=0 --speed=115200\”" + "GRUB_SERIAL_COMMAND" : "\"serial --unit=%s --speed=%s\"" % (unit, baudrate), } # Otherwise enable a generic VGA console -- 2.47.3