Remap image path for Windows QEMU while under WSL2

This commit is contained in:
Furkan Mudanyali 2023-11-11 14:01:51 +03:00
parent 2fad0698d1
commit 86ecbc67f7
2 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,12 @@ all: $(IMAGE_NAME).img
.PHONY: run
run: $(IMAGE_NAME).img
qemu-system-aarch64 -M raspi3b -kernel u-boot/u-boot.bin -drive file=build/$(IMAGE_NAME).img,if=sd,format=raw -serial null -serial stdio
if [ "$$(uname -a | grep -i 'microsoft')" ]; then \
export IMAGE_PATH=$$(wslpath -wa build/$(IMAGE_NAME).img); \
else \
export IMAGE_PATH=build/$(IMAGE_NAME).img; \
fi; \
qemu-system-aarch64 -M raspi3b -kernel u-boot/u-boot.bin -drive file=$$IMAGE_PATH,if=sd,format=raw -serial null -serial stdio
uboot:
git clone https://github.com/u-boot/u-boot.git --branch=v2023.10 --depth=1 2>/dev/null | true

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -euo pipefail
export PREFIX="$HOME/cross-aarch64"
export TARGET="aarch64-none-elf"