From dc4cafc29f54b757fa64000e1b34e2b1d5f75ab2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 25 Jun 2026 16:41:14 -0400 Subject: [PATCH] Rework autoconsole logic Match autocons Skip unless EFI x86_64. If SPCR, trust it and use that unconditionally. Otherwise, if only one can respond to TIOCMGET, then use that one. If multiple can respond, but exactly one shows carrier, use that. --- .../common/profile/scripts/autoconsole | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/autoconsole b/confluent_osdeploy/common/profile/scripts/autoconsole index 421c2e8a..155c4371 100644 --- a/confluent_osdeploy/common/profile/scripts/autoconsole +++ b/confluent_osdeploy/common/profile/scripts/autoconsole @@ -10,11 +10,13 @@ # serial port is not reporting DCD, then it doesn't look like a comfortable enough scenario import fcntl +import glob import os import os.path import struct import subprocess import termios +import platform addrtoname = { @@ -74,9 +76,8 @@ def fixup_ubuntu_grub_serial(): grubout.write(grubline + '\n') subprocess.check_call(['update-grub']) -def get_serial_config(): - if not os.path.exists('/sys/firmware/efi'): - return None + +def get_spcr_config(): if not os.path.exists('/sys/firmware/acpi/tables/SPCR'): return None spcr = open("/sys/firmware/acpi/tables/SPCR", "rb") @@ -99,14 +100,39 @@ def get_serial_config(): currattr = termios.tcgetattr(ttyf) currattr[4:6] = [0, termiobaud[retval['speed']]] termios.tcsetattr(ttyf, termios.TCSANOW, currattr) - retval['connected'] = bool(struct.unpack('