From 200f2ad01cf77f9e242fb27ff6577ddd5a1ee9fe Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 14 Mar 2025 06:13:07 +0100 Subject: [PATCH] Update proc.sh --- src/proc.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/proc.sh b/src/proc.sh index f7ec053..de2b7bb 100644 --- a/src/proc.sh +++ b/src/proc.sh @@ -32,18 +32,21 @@ if [ -e "$MSRS" ]; then fi fi +CLOCKSOURCE="tsc" +[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter" CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource" -if [ -f "$CLOCK" ]; then + +if [ ! -f "$CLOCK" ]; then + warn "file \"$CLOCK\" cannot not found?" +else result=$(<"$CLOCK") case "${result,,}" in - "arch_sys_counter" ) ;; + "${CLOCKSOURCE,,}" ) ;; "kvm-clock" ) info "Nested KVM virtualization detected.." ;; "hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected.." ;; - "hpet" ) warn "unsupported clock source detected: '$result'." ;; - *) warn "unexpected clock source detected: '$result'." ;; + "hpet" ) warn "unsupported clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE'" ;; + *) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE'" ;; esac -else - warn "file \"$CLOCK\" cannot not found?" fi if [[ "${ARCH,,}" != "arm64" ]]; then