Update boot.sh
This commit is contained in:
parent
0342049ffb
commit
cb053399a6
1 changed files with 4 additions and 2 deletions
|
@ -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.." ;;
|
||||||
|
|
Loading…
Reference in a new issue