diff --git a/Dockerfile b/Dockerfile index 38c6438..2fc0f2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apk --update --no-cache add unzip && \ rm -rf /tmp/* /var/tmp/* /var/cache/apk/* FROM scratch AS runner -COPY --from=qemux/qemu:7.04 / / +COPY --from=qemux/qemu:7.05 / / ARG VERSION_ARG="0.0" ARG VERSION_KVM_OPENCORE="v21" diff --git a/src/boot.sh b/src/boot.sh index cfec337..e3735f8 100644 --- a/src/boot.sh +++ b/src/boot.sh @@ -168,13 +168,14 @@ else fi CLOCKSOURCE="tsc" -[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter" +[[ "${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") + result="${result//[![:print:]]/}" case "${result,,}" in "${CLOCKSOURCE,,}" ) ;; "kvm-clock" ) diff --git a/src/install.sh b/src/install.sh index b547dfe..6d4a3b2 100644 --- a/src/install.sh +++ b/src/install.sh @@ -154,10 +154,12 @@ generateID() { [ -n "$UUID" ] && return 0 [ -s "$file" ] && UUID=$(<"$file") + UUID="${UUID//[![:print:]]/}" [ -n "$UUID" ] && return 0 UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random) UUID="${UUID^^}" + UUID="${UUID//[![:print:]]/}" echo "$UUID" > "$file" return 0 @@ -169,6 +171,7 @@ generateAddress() { [ -n "$MAC" ] && return 0 [ -s "$file" ] && MAC=$(<"$file") + MAC="${MAC//[![:print:]]/}" [ -n "$MAC" ] && return 0 # Generate Apple MAC address based on Docker container ID in hostname @@ -187,6 +190,8 @@ generateSerial() { [ -n "$SN" ] && [ -n "$MLB" ] && return 0 [ -s "$file" ] && SN=$(<"$file") [ -s "$file2" ] && MLB=$(<"$file2") + SN="${SN//[![:print:]]/}" + MLB="${MLB//[![:print:]]/}" [ -n "$SN" ] && [ -n "$MLB" ] && return 0 # Generate unique serial numbers for machine @@ -213,6 +218,7 @@ fi STORED_VERSION="" if [ -f "$BASE_VERSION" ]; then STORED_VERSION=$(<"$BASE_VERSION") + STORED_VERSION="${STORED_VERSION//[![:print:]]/}" fi if [ "$VERSION" != "$STORED_VERSION" ]; then