feat(darwin): add support for guname on darwin

This commit is contained in:
Martin Wimpress 2024-05-14 14:35:22 +01:00 committed by Martin Wimpress
parent 9cfc4f6ed7
commit 8f9f7d8aed
1 changed files with 13 additions and 3 deletions

View File

@ -962,9 +962,9 @@ function vm_boot() {
VGA=""
VIDEO=""
KERNEL_NAME=$(uname --kernel-name)
KERNEL_NODE="($(uname --nodename))"
KERNEL_VER=$(uname --kernel-release | cut -d'.' -f1-2)
KERNEL_NAME="$(${UNAME} --kernel-name)"
KERNEL_NODE="$(${UNAME} --nodename)"
KERNEL_VER="$(${UNAME} --kernel-release | cut -d'.' -f1-2)"
if [ -e /etc/os-release ]; then
LSB_DESCRIPTION=$(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)
@ -1687,6 +1687,16 @@ if [ ! -e "${QEMU}" ] || [ ! -e "${QEMU_IMG}" ]; then
exit 1
fi
# Check for gnu tools on macOS
UNAME="uname"
if command -v guname &>/dev/null; then
UNAME="guname"
fi
DARWIN=0
if [ "${UNAME}" == "Darwin" ]; then
DARWIN=1
fi
QEMU_VER_LONG=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1)
QEMU_VER_SHORT=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1 | sed 's/\.//g' | cut -c1-2)
if [ "${QEMU_VER_SHORT}" -lt 60 ]; then