From 8ed87a5023061308b575227125a351061e6d5161 Mon Sep 17 00:00:00 2001 From: Gaurav Mehta Date: Thu, 13 Jun 2024 19:44:51 +1000 Subject: [PATCH] change logic to handle arm machines better --- package/harvester-os/files/usr/bin/setup-installer.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package/harvester-os/files/usr/bin/setup-installer.sh b/package/harvester-os/files/usr/bin/setup-installer.sh index b34fd6da3..83a09cd0e 100755 --- a/package/harvester-os/files/usr/bin/setup-installer.sh +++ b/package/harvester-os/files/usr/bin/setup-installer.sh @@ -44,12 +44,17 @@ echo "Remove the serial-getty service..." rm -rf "/etc/systemd/system/serial-getty*" # reverse the ttys to start from the last one -for TTY in $(cat /sys/class/tty/console/active); do +read -r -a tty_list < /sys/class/tty/console/active + +for TTY in "${tty_list[@]}"; do tty_num=${TTY#tty} #for arm64 the terminals are named /dev/ttyAMA* + #skip /dev/ttyAMA* if an additional tty is present + #on equinix metal /dev/ttyAMA is the only terminal available + #so needs to be used as default option PLATFORM=$(uname -m) - if [ $PLATFORM == "aarch64" ] + if [[ $PLATFORM == "aarch64" && ${#tty_list[@]} > 1 ]] then if [[ $tty_num =~ ^AMA[0-9]+$ ]]; then continue