mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-04 07:27:19 +08:00
fix: Remove non-printable characters (#949)
This commit is contained in:
parent
ad26129375
commit
0c7acd6e71
@ -5,6 +5,7 @@ set -Eeuo pipefail
|
|||||||
|
|
||||||
if [ -f "$STORAGE/dsm.ver" ]; then
|
if [ -f "$STORAGE/dsm.ver" ]; then
|
||||||
BASE=$(<"$STORAGE/dsm.ver")
|
BASE=$(<"$STORAGE/dsm.ver")
|
||||||
|
BASE="${BASE//[![:print:]]/}"
|
||||||
[ -z "$BASE" ] && BASE="DSM_VirtualDSM_69057"
|
[ -z "$BASE" ] && BASE="DSM_VirtualDSM_69057"
|
||||||
else
|
else
|
||||||
# Fallback for old installs
|
# Fallback for old installs
|
||||||
|
@ -399,6 +399,7 @@ getInfo() {
|
|||||||
if [ -z "$VM_NET_MAC" ]; then
|
if [ -z "$VM_NET_MAC" ]; then
|
||||||
local file="$STORAGE/dsm.mac"
|
local file="$STORAGE/dsm.mac"
|
||||||
[ -s "$file" ] && VM_NET_MAC=$(<"$file")
|
[ -s "$file" ] && VM_NET_MAC=$(<"$file")
|
||||||
|
VM_NET_MAC="${VM_NET_MAC//[![:print:]]/}"
|
||||||
if [ -z "$VM_NET_MAC" ]; then
|
if [ -z "$VM_NET_MAC" ]; then
|
||||||
# Generate MAC address based on Docker container ID in hostname
|
# Generate MAC address based on Docker container ID in hostname
|
||||||
VM_NET_MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:11:32:\3:\4:\5/')
|
VM_NET_MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:11:32:\3:\4:\5/')
|
||||||
|
@ -10,19 +10,20 @@ set -Eeuo pipefail
|
|||||||
: "${DEF_MODEL:="qemu64"}"
|
: "${DEF_MODEL:="qemu64"}"
|
||||||
|
|
||||||
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")
|
||||||
|
result="${result//[![:print:]]/}"
|
||||||
case "${result,,}" in
|
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.." ;;
|
||||||
"hpet" ) warn "unsupported clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE'" ;;
|
"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'" ;;
|
*) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE'." ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user