Update boot.sh

This commit is contained in:
Kroese 2025-03-24 13:16:24 +01:00 committed by GitHub
parent 0342049ffb
commit cb053399a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,20 +75,22 @@ esac
MSRS="/sys/module/kvm/parameters/ignore_msrs" MSRS="/sys/module/kvm/parameters/ignore_msrs"
if [ -e "$MSRS" ]; then if [ -e "$MSRS" ]; then
result=$(<"$MSRS") result=$(<"$MSRS")
result="${result//[![:print:]]/}"
if [[ "$result" == "0" ]] || [[ "${result^^}" == "N" ]]; then if [[ "$result" == "0" ]] || [[ "${result^^}" == "N" ]]; then
echo 1 | tee "$MSRS" > /dev/null 2>&1 || true echo 1 | tee "$MSRS" > /dev/null 2>&1 || true
fi fi
fi fi
CLOCKSOURCE="tsc" CLOCKSOURCE="tsc"
[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter" [[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter"
CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource" CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource"
if [ ! -f "$CLOCK" ]; then if [ ! -f "$CLOCK" ]; then
warn "file \"$CLOCK\" cannot not found?" warn "file \"$CLOCK\" cannot not found?"
else else
result=$(<"$CLOCK") result=$(<"$CLOCK")
case "${result//[^[:alpha:]_- ]/}" in result="${result//[![:print:]]/}"
case "${result,,}" in
"${CLOCKSOURCE,,}" ) ;; "${CLOCKSOURCE,,}" ) ;;
"kvm-clock" ) info "Nested KVM virtualization detected.." ;; "kvm-clock" ) info "Nested KVM virtualization detected.." ;;
"hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected.." ;; "hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected.." ;;