Skip to content

fix: unify TTY selection logic across ARM64 and AMD64 - #1284

Open
Hero2633 wants to merge 1 commit into
harvester:masterfrom
Hero2633:fix/unified-tty-selection
Open

fix: unify TTY selection logic across ARM64 and AMD64#1284
Hero2633 wants to merge 1 commit into
harvester:masterfrom
Hero2633:fix/unified-tty-selection

Conversation

@Hero2633

Copy link
Copy Markdown

Problem:

On ARM64 servers such as Kunpeng 920, after booting the Harvester ISO, the screen directly shows the rancher login: prompt instead of entering the Harvester interactive installer UI.
de2812d0534510e6fbd2ddf784ab6eb9

Observed behavior:

  • The ISO boots successfully
  • The system enters the live environment normally
  • The local display does not show the Harvester-installer UI
  • The screen stays at rancher login:
  • harvester-installer output is actually redirected to the serial console (for example ttyS0)

Further investigation showed that this problem is related to the installer's TTY selection logic: when both a local virtual terminal and a serial console are present (for example ttyS0 and tty1), the installer may be bound to the serial console first instead of the local tty1.
bff1e574e5cb95b6bc3068e73b563d8d

Solution:

This PR unifies the TTY selection logic used by the installer so that startup, internal console detection in Go, and getty restart handling all follow the same priority:

tty1 > other virtual ttys > serial console

This PR includes:

  • Updating setup-installer.sh to prefer tty1, then other virtual terminals, and fall back to serial console only when no virtual tty is available
  • Updating pkg/console/tty.go so the Go-side console selection logic matches the shell-side behavior
  • Updating harv-restart-services to use the same priority when restarting the console getty
  • Adding / updating tests for TTY selection behavior

This makes console selection behavior consistent across ARM64 and AMD64, and fixes the case where installer output is redirected to serial console even though a local virtual terminal is available.

Related Issue(s):

none

Test plan:

Verified with:

  • bash -n package/harvester-os/files/usr/bin/setup-installer.sh
  • bash -n package/harvester-os/files/usr/sbin/harv-restart-services
  • go test ./pkg/console

Additional documentation or context

In the affected environment, the installer could be manually brought back to the local terminal using:

systemctl stop serial-getty@ttyS0.service
pkill -9 -f harvester-installer
start-installer.sh

Signed-off-by: zuoyi.wan <zuoyi.wan@winicssec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant