mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Meta: Auto-detect where QEMU is installed on Windows
This commit is contained in:
parent
ffee3d6c5d
commit
5445155dba
2 changed files with 11 additions and 9 deletions
|
@ -34,12 +34,6 @@ will need to install the tools as well as the system emulators for i386 and x86_
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Locate the `qemu-system-x86_64.exe` executable in WSL.
|
|
||||||
By default this will be at `/mnt/c/Program Files/qemu/qemu-system-x86_64.exe`.
|
|
||||||
|
|
||||||
Set the `SERENITY_QEMU_BIN` environment variable to that location. For example: \
|
|
||||||
`export SERENITY_QEMU_BIN='/mnt/c/Program Files/qemu/qemu-system-x86_64.exe'`
|
|
||||||
|
|
||||||
Run `Meta/serenity.sh run` to build and run SerenityOS as usual.
|
Run `Meta/serenity.sh run` to build and run SerenityOS as usual.
|
||||||
|
|
||||||
### Hardware acceleration
|
### Hardware acceleration
|
||||||
|
|
14
Meta/run.sh
14
Meta/run.sh
|
@ -38,13 +38,21 @@ PATH="$SCRIPT_DIR/../Toolchain/Local/i686/bin:$PATH"
|
||||||
SERENITY_RUN="${SERENITY_RUN:-$1}"
|
SERENITY_RUN="${SERENITY_RUN:-$1}"
|
||||||
|
|
||||||
if [ -z "$SERENITY_QEMU_BIN" ]; then
|
if [ -z "$SERENITY_QEMU_BIN" ]; then
|
||||||
if command -v qemu-system-x86_64 >/dev/null; then
|
if command -v wslpath >/dev/null; then
|
||||||
SERENITY_QEMU_BIN="qemu-system-x86_64"
|
QEMU_INSTALL_DIR=$(reg.exe query 'HKLM\Software\QEMU' /v Install_Dir /t REG_SZ | grep '^ Install_Dir' | sed 's/ / /g' | cut -f4- -d' ')
|
||||||
|
if [ -z "$QEMU_INSTALL_DIR" ]; then
|
||||||
|
die "Could not determine where QEMU for Windows is installed. Please make sure QEMU is installed or set SERENITY_QEMU_BIN if it is already installed."
|
||||||
|
fi
|
||||||
|
QEMU_BINARY_PREFIX="$(wslpath -- "${QEMU_INSTALL_DIR}" | tr -d '\r\n')/"
|
||||||
|
QEMU_BINARY_SUFFIX=".exe"
|
||||||
|
fi
|
||||||
|
if command -v "${QEMU_BINARY_PREFIX}qemu-system-x86_64${QEMU_BINARY_SUFFIX}" >/dev/null; then
|
||||||
|
SERENITY_QEMU_BIN="${QEMU_BINARY_PREFIX}qemu-system-x86_64${QEMU_BINARY_SUFFIX}"
|
||||||
else
|
else
|
||||||
if [ "$SERENITY_ARCH" = "x86_64" ]; then
|
if [ "$SERENITY_ARCH" = "x86_64" ]; then
|
||||||
die "Please install the 64-bit QEMU system emulator (qemu-system-x86_64)."
|
die "Please install the 64-bit QEMU system emulator (qemu-system-x86_64)."
|
||||||
fi
|
fi
|
||||||
SERENITY_QEMU_BIN="qemu-system-i386"
|
SERENITY_QEMU_BIN="${QEMU_BINARY_PREFIX}qemu-system-i386${QEMU_BINARY_SUFFIX}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue