Update boot.sh
This commit is contained in:
parent
edb1657bb1
commit
1c7b2798a1
1 changed files with 25 additions and 0 deletions
25
src/boot.sh
25
src/boot.sh
|
@ -74,4 +74,29 @@ case "${BOOT_MODE,,}" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
MSRS="/sys/module/kvm/parameters/ignore_msrs"
|
||||||
|
if [ -e "$MSRS" ]; then
|
||||||
|
result=$(<"$MSRS")
|
||||||
|
if [[ "$result" == "0" ]] || [[ "${result^^}" == "N" ]]; then
|
||||||
|
echo 1 | tee "$MSRS" > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLOCKSOURCE="tsc"
|
||||||
|
[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter"
|
||||||
|
CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource"
|
||||||
|
|
||||||
|
if [ ! -f "$CLOCK" ]; then
|
||||||
|
warn "file \"$CLOCK\" cannot not found?"
|
||||||
|
else
|
||||||
|
result=$(<"$CLOCK")
|
||||||
|
case "${result,,}" in
|
||||||
|
"${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'. Please set host clock source to '$CLOCKSOURCE'" ;;
|
||||||
|
*) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE'" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue