feat(darwin): add support for guname on darwin
This commit is contained in:
parent
9cfc4f6ed7
commit
8f9f7d8aed
16
quickemu
16
quickemu
|
@ -962,9 +962,9 @@ function vm_boot() {
|
||||||
VGA=""
|
VGA=""
|
||||||
VIDEO=""
|
VIDEO=""
|
||||||
|
|
||||||
KERNEL_NAME=$(uname --kernel-name)
|
KERNEL_NAME="$(${UNAME} --kernel-name)"
|
||||||
KERNEL_NODE="($(uname --nodename))"
|
KERNEL_NODE="$(${UNAME} --nodename)"
|
||||||
KERNEL_VER=$(uname --kernel-release | cut -d'.' -f1-2)
|
KERNEL_VER="$(${UNAME} --kernel-release | cut -d'.' -f1-2)"
|
||||||
|
|
||||||
if [ -e /etc/os-release ]; then
|
if [ -e /etc/os-release ]; then
|
||||||
LSB_DESCRIPTION=$(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)
|
LSB_DESCRIPTION=$(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)
|
||||||
|
@ -1687,6 +1687,16 @@ if [ ! -e "${QEMU}" ] || [ ! -e "${QEMU_IMG}" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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_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)
|
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
|
if [ "${QEMU_VER_SHORT}" -lt 60 ]; then
|
||||||
|
|
Loading…
Reference in New Issue